JSON Schema Sample Data Generator
Generate realistic sample JSON from a JSON Schema. Great for creating mock data, test fixtures, and LLM structured-output examples.
Input JSON Schema
Supported keywords
- Types:
string,number,integer,boolean,null,array,object(including type arrays) - Strings:
format(email, date-time, date, time, uri, uuid, hostname, ipv4, ipv6, password),pattern,minLength/maxLength,enum,const - Numbers:
minimum/maximum,multipleOf,exclusiveMinimum/exclusiveMaximum - Objects & arrays:
properties,required,additionalProperties,items,minItems/maxItems - Composition:
oneOf/anyOf(first branch),allOf(merged),example/defaultvalues
About JSON Schema Sample Data Generator
Writing mock data by hand is tedious and drifts from your schema. This tool reads a JSON Schema and produces a sample document that satisfies it — respecting types, formats, required fields, and value constraints — so you get test fixtures and placeholder data that match your contract. With LLM structured output, a schema-compliant example is also a quick way to see what a model is expected to return.
Use it when you need fixtures for unit tests, placeholder payloads for frontend development, or a concrete example to pair with a published schema. Generated values are deterministic per schema, but they are meant as plausible examples, not production data. Recursive schemas are depth-limited to keep output finite, and the implementation covers the common draft-07 keyword set listed above.
The order keywords are resolved in
Generation is a priority chain, and the order explains most surprising output. `const` wins outright, then the first `enum` member, then `example`, then `default` — all four short-circuit before the declared type is even considered, which is what lets a schema carry illustrative values. Composition comes next: `oneOf` and `anyOf` generate from the first branch only, and `allOf` is merged with a shallow `Object.assign`, so a later subschema overwrites an earlier one on conflicting keys rather than intersecting them.
Type resolution handles the multi-type form by filtering `null` out and taking what remains first, so `["string", "null"]` yields a plain string. A schema with no `type` at all is inferred from context: `properties` or `additionalProperties` implies object, `items` implies array, and anything else falls back to string.
How each type gets a plausible value
Strings consult a lookup table of thirteen `format` values first, which is why `date-time` yields a full ISO timestamp with a `Z` suffix. Failing that, `pattern` is matched against exactly three shapes — `[a-zA-Z0-9_-]+`, `[0-9]+` and `\d+` — and everything else falls back to `value123`, which will usually violate the regex you wrote. Length bounds are met by repeating or truncating the string `sample string`.
Numbers pick a midpoint between the effective bounds, treating `exclusiveMinimum` and `exclusiveMaximum` as one unit either side, then honour `multipleOf` by rounding. Integers return the floor of the minimum plus one, which lands inside the range but overshoots when `minimum` and `maximum` are equal. Arrays generate between one and three items capped by `maxItems`, and a missing `items` yields an empty array.
Boundaries of the implementation
Recursion stops at depth six, beyond which every value becomes `null`. That keeps a self-referential schema finite, but deeply nested documents quietly degrade at the bottom instead of raising an error. The keyword set is the common draft-07 subset listed on the page: `$ref` and `$defs` are not resolved, so a schema built on references generates empty objects, and conditional keywords such as `if`, `then` and `dependentRequired` are ignored.
An `additionalProperties` schema contributes a single sample property literally named `extra`, and boolean fields always come out `true`. Optional properties are generated on every record regardless of `required`, since a sample document carries no notion of presence — for a fixture that needs genuine variation, delete the fields you want omitted by hand.
Frequently Asked Questions
How do I generate mock data from a JSON Schema?
Can I control the generated values?
Is my data sent to a server?
Do I need an account or API key?
Can I use these tools offline?
All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.