Paste a JSON Schema and generate realistic sample JSON that matches it.
Paste or write a JSON Schema (draft-04 to 2020-12).
Mock data generated from your schema.
Generating…
This free JSON generator from schema turns a JSON Schema into realistic sample JSON. Paste the schema for an API request, a webhook payload or a config file, and you get mock data that follows it: the right types, every required field, values inside your ranges, and strings that look like real emails, names, URLs and dates rather than "string". It is a JSON Schema mock data generator that needs no install and no sign-up, and it runs in your browser.
It is the reverse of the JSON Schema Generator, which builds a schema from sample JSON. If you don't have a schema yet and just want test data, the template-based JSON Generator gives you full control over every field.
Formats and enums decide most values; property names fill in the rest. Optional fields such as seats and tags are included unless you ask for required fields only.
{
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"email": { "type": "string", "format": "email" },
"plan": { "enum": ["free", "pro", "team"] },
"seats": { "type": "integer", "minimum": 1, "maximum": 50 },
"tags": {
"type": "array",
"items": { "type": "string" },
"maxItems": 3
}
},
"required": ["id", "email", "plan"]
}{
"id": "0b6f2c1e-5d4a-4f7e-9a63-2c8e1d7f4b90",
"email": "Marisa.Kling@hotmail.com",
"plan": "pro",
"seats": 12,
"tags": [
"harbor",
"violin"
]
}| Keyword | What the generator does |
|---|---|
type | Picks the type; with a list such as ["string", "null"] it is occasionally null. |
properties, required | Fills every property, or only the required ones when that option is ticked. |
items, prefixItems | Generates list items, or each position of a tuple. |
minItems, maxItems | Arrays get 1 to 5 items unless you set bounds; never more than 100. |
enum, const, default, examples | Used as given: a random enum value, the const, an example or the default. |
format | email, uri, uuid, date, date-time, time, ipv4, ipv6 and hostname get valid values. |
minimum, maximum, multipleOf | Numbers stay in range, honour exclusive bounds and land on the multiple. |
minLength, maxLength, pattern | Strings fit the length; simple regex patterns are matched exactly. |
oneOf, anyOf, allOf | oneOf and anyOf pick one branch; allOf merges every branch into one object. |
$ref | Follows #/definitions and #/$defs references, with a guard for recursive schemas. |
Limits worth knowing: only local references (#/...) are followed, so a $ref to another file or URL is skipped; complex patterns with lookaheads or back-references fall back to a plain string; and if/then/else, not and patternProperties are ignored. Need ready-made data instead? Browse the example templates.
Paste your JSON Schema into the JSON Schema editor. Sample JSON that matches it appears on the right as you type. Click Regenerate for new random values, choose how many samples you want, then copy the result or download it as JSON, CSV or YAML.
Draft-04, draft-06, draft-07, 2019-09 and 2020-12. The generator reads the keywords those drafts share, plus both ways of writing tuples (items as an array, or prefixItems) and both forms of exclusiveMinimum and exclusiveMaximum.
type (including arrays of types and null), properties, required, nested objects, items, prefixItems, minItems, maxItems, uniqueItems, enum, const, default, examples, format, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, minLength, maxLength, pattern, oneOf, anyOf, allOf, and local $ref to #/definitions or #/$defs. Keywords it doesn't know are ignored, never an error.
Strings with a format such as email, uri, uuid, date-time or ipv4 get a valid value in that format. Strings without a format are matched by property name, so firstName gets a first name, city a city, phone a phone number and createdAt a timestamp. Numbers named age, price or rating get sensible ranges too, always inside your minimum and maximum.
Yes. A $ref that points back to itself, such as a tree node with children, is expanded a couple of levels deep and then stopped: optional links are left out and recursive arrays end up empty, so the output is always finite.
Yes. Tick Required fields only to leave out every property that isn't listed in required, at every level. By default all properties are included, which gives fuller mock data.
No. Generation runs entirely in your browser. Your schema is saved in your browser's local storage so it is still there next time, but it is never sent to our servers.