JSON Schema Sample Data Generator
Paste a JSON Schema and generate conforming sample JSON in your browser. Your schema stays on your device.
Your JSON Schema is parsed and turned into sample data locally in your browser and never uploaded, but avoid embedding real secrets or production values in the schema you paste.
Have JSON but need the schema? Try the JSON Schema Generator.
About JSON Schema Sample Data Generator
This JSON Schema sample data generator turns a schema into realistic sample JSON that actually conforms to it. Paste a draft-07, 2019-09, or 2020-12 schema and it builds data that respects your types, string formats like email, date, uri, and uuid, enum choices, required properties, minimum and maximum bounds, and combinators such as allOf, anyOf, and oneOf. Choose how many samples to produce and they are wrapped in an array, or generate a single object. Toggle realistic values to fill string formats with lifelike names, emails, and dates instead of plain placeholders. Use it to seed a database, mock an API response, or build fixtures for tests without hand-writing example payloads. The schema you paste is processed entirely in your browser and never leaves your device.
Features
- Reads JSON Schema draft-07, 2019-09, and 2020-12 documents
- Honors types, required properties, and minimum/maximum numeric bounds
- Fills string formats like email, date-time, uri, and uuid with valid values
- Respects enum and const so generated values stay within the allowed set
- Resolves combinators including allOf, anyOf, and oneOf, plus $ref definitions
- Generate one object or many samples wrapped in an array
- Optional realistic values powered by lifelike names, emails, and dates
- Copy the result or download it as sample-data.json in one click
How to use the JSON Schema Sample Data Generator
- Paste your JSON Schema into the schema box, or click Load example.
- Set how many samples you want and toggle realistic values on or off.
- Read the conforming sample JSON in the output panel on the right.
- Click Copy to grab the data, or download it as sample-data.json.
Example
Input
{
"type": "object",
"required": ["id", "email", "role"],
"properties": {
"id": { "type": "integer", "minimum": 1 },
"email": { "type": "string", "format": "email" },
"role": { "enum": ["admin", "editor", "viewer"] }
}
}
Output
{
"id": 254,
"email": "ada@example.com",
"role": "editor"
}
The integer, email format, and enum constraints are all satisfied in the generated object.
Common errors & troubleshooting
- The output says the schema isn't valid JSON. — The generator expects a JSON object. Check for trailing commas, unquoted keys, or single quotes, and paste a complete, well-formed schema.
- A required property is missing from the generated data. — List the property in the schema's required array and give it a type; properties without a type or that only appear as optional may be skipped.
- A string format like email or uuid comes out as random characters. — Turn on realistic values so recognized formats are filled with lifelike samples instead of pattern-based placeholders.
- An anyOf or oneOf branch produces data you didn't expect. — The generator picks one matching branch per run; tighten each branch with its own required and type keywords so every option stays valid.
Frequently asked questions
- Which JSON Schema drafts are supported?
- It handles draft-07, 2019-09, and 2020-12 schemas, covering types, string formats, enums, required properties, numeric bounds, and combinators like allOf, anyOf, and oneOf.
- How is this different from validating a JSON Schema?
- Validation checks whether existing data matches a schema. This tool works in the opposite direction: it reads a schema and generates new sample data that conforms to it, so you can seed tests, mocks, or a database.
- How do I generate an array of multiple records?
- Set the Samples count above 1. Each sample is generated from the same schema and the results are wrapped in a JSON array; a count of 1 returns a single object instead.
- What does the realistic values toggle do?
- With it on, recognized string formats and fields are filled with lifelike names, emails, dates, and URLs. With it off, values are generated from the schema's own constraints and patterns.
- Does the generated data always satisfy the schema?
- The generator honors types, formats, enums, required fields, and numeric bounds. Very complex not or conditional if/then/else rules can be hard to satisfy exactly, so validate the output against your schema for critical fixtures.
- Is my schema uploaded anywhere?
- No. The schema you paste is parsed and generated entirely in your browser, so it is processed locally on your device and never sent to a server.
Related tools
All ArrayKit tools