JSON Schema Sample Data Generator
Walk a JSON Schema and generate seeded, constraint-aware sample JSON. Nothing leaves your browser.
JSON Schema
Generated samples
No samples yet
Load an example schema or paste your own — generation is deterministic for a given seed.
Details
Paste a draft-07, 2019-09 or 2020-12 schema and generate up to 50 sample instances. The walker honors types, enums, const, required properties, string lengths, numeric bounds, multipleOf, array sizes, uniqueItems, formats such as email/uuid/date-time, allOf/oneOf/anyOf and internal $ref with a recursion depth cap. A seed makes every run reproducible, and a bundled validator checks each sample against the supported keyword subset before showing it. External $refs and regex patterns are reported as unsupported rather than silently ignored.
More examples
API fixture from a contract
{ "type": "object", "required": ["id", "email"], "properties": { "id": { "type": "string", "format": "uuid" }, "email": { "type": "string", "format": "email" } } }Three samples yield valid-looking UUIDs and addresses for Postman or a test suite.
Branch coverage with oneOf
{ "oneOf": [{ "const": "card" }, { "const": "bank" }, { "const": "cash" }] }The branch rotates with the sample index, so four samples exercise all three payment methods.
Reproducible CI data
Seed: fixtures-v1 · Samples: 5 · Download: samples.ndjsonThe same seed and schema always produce byte-identical samples, so fixtures never drift between runs.
Examples
Contract fixture
{ "type": "object", "required": ["id"], "properties": { "id": { "type": "string", "format": "uuid" } } }[ { "id": "7c2d…" }, … ]The UUID format produces syntactically valid identifiers, three samples by default.
Branch rotation
{ "oneOf": [{ "const": "card" }, { "const": "bank" }] }["card", "bank", "card"]Increasing the sample count cycles through the declared alternatives.
About this tool
JSON Schema Sample Data Generator turns a schema contract into concrete example instances. It walks types, enums, const values, required properties, string lengths, numeric bounds, array sizes and format hints, then checks every generated sample against the supported keyword subset before showing it.
A seed hashes to a deterministic 32-bit stream, so the same schema and seed always produce the same samples — handy for checked-in fixtures and reproducible bug reports. oneOf/anyOf branches rotate with the sample index to cover alternatives, and internal $ref pointers resolve with a recursion depth cap. Everything runs locally; no schema is uploaded.
What this tool does not do
- External $refs are rejected with a clear error; only internal #/... pointers are resolved.
- Regex `pattern` values are not synthesized and are reported in the warnings strip.
- Recursion is capped at depth 3 and uses a minimal legal value to terminate cycles.
- Standalone `not` constraints cannot be enforced by the generator.
How to use this tool
Paste a schema
Paste a draft-07, 2019-09 or 2020-12 JSON Schema. The draft chip shows which dialect was detected.
Choose seed and count
Set a seed string and a sample count from 1 to 50. Identical settings always produce identical samples.
Review validation
Check the valid/flagged stats and warnings strip for unsupported keywords or unsatisfiable constraints.
Export fixtures
Copy the array, download samples.json, or download NDJSON for a fixture pipeline.
Use cases
Mock server payloads
Turn an OpenAPI-derived component schema into realistic responses for a local mock API.
Test fixtures in CI
Commit a seed and schema pair so regenerated fixtures never produce noisy diffs.
Documentation examples
Generate valid-looking sample payloads for endpoint docs without hand-maintaining them.
Supported schema keywords
| Keyword | Behavior |
|---|---|
| type / enum / const | Primitive dispatch, enum values cycle across samples, const is emitted verbatim. |
| required / properties | Required keys are always generated; optional keys are sampled. |
| minLength / maxLength | Generated words are padded or truncated to the requested bounds. |
| minimum / maximum / multipleOf | Numbers respect bounds and are snapped to multiples without float drift. |
| items / minItems / maxItems / uniqueItems | Arrays get a bounded item count and retry to make values unique. |
| format | email, uuid, date-time, date, time, uri, hostname, ipv4/ipv6, json-pointer and regex hints are recognized. |
| allOf / oneOf / anyOf | allOf constraints merge; oneOf/anyOf branches rotate across samples. |
| $ref | Internal #/definitions and #/$defs pointers resolve; recursion stops at depth 3. |
External $refs, regex `pattern` synthesis and standalone `not` are reported as warnings or errors rather than silently ignored.
Common mistakes
Mistake:Expecting every JSON Schema keyword to be enforced.
Fix:The generator covers a documented subset; pattern, not and external $ref produce explicit warnings or errors.
Mistake:Using an external $ref URL.
Fix:Inline the referenced definitions under $defs or definitions — remote resolution is deliberately unsupported.
Mistake:Assuming realistic mode invents real people.
Fix:All names, domains and addresses come from small fictional pools; the data is synthetic.
Frequently asked questions
Which JSON Schema drafts are supported?
The generator detects draft-07, 2019-09 and 2020-12 schemas and walks the shared keyword subset: types, enum, const, required, properties, bounds, formats, allOf/oneOf/anyOf and internal $ref. Draft-specific keywords outside that subset are reported rather than silently misinterpreted.
Are the generated samples guaranteed to be valid?
Every sample is checked with a bundled validator covering the supported keywords, and invalid samples are regenerated up to three times with an attempt-specific seed. Samples that still fail are shown with a reason in the warnings strip, so the validity status is never hidden.
How does seeding work?
The seed string is hashed to a 32-bit integer that drives a mulberry32 pseudo-random stream. The same schema, seed and sample count always produce byte-identical output. Each sample and retry uses a derived stream, so changing the count does not reshuffle earlier samples.
Can it handle oneOf and anyOf?
Yes. Branches rotate with the sample index, so asking for more samples than branches exercises each alternative. allOf constraints are shallow-merged before generation; standalone not constraints cannot be enforced and are flagged with a warning.
What about pattern properties and external refs?
One patternProperties entry per object is sampled with a synthesized key. External $refs (http/https) are rejected with an error that asks you to paste the referenced schema inline, because the tool never fetches anything from the network.
References & standards
Related tools
ABA Routing Number Generator
Generate 9-digit US ABA routing numbers with weighted Mod-10 checks.
Address Generator
Generate realistic addresses in the correct format for 21 countries — single-line, multi-line, JSON or HTML — plus a postcode validator. Test data only, runs in your browser.
API Key Generator
Generate realistic test API keys — custom prefixes, lengths, alphabets, optional checksum, bulk .env/CSV export. Locally in your browser.
Argentina CUIT / CUIL Generator
Generate and validate 11-digit Argentine CUIT and CUIL numbers with AFIP Mod-11 check digits.
ASCII Text Art Generator
Turn text into large ASCII art banners with multiple figlet fonts
Australia ABN Generator
Generate and validate 11-digit Australian Business Numbers (ABN) using weighted Mod-89.