JSON Schema to JSON
This tool generates example data that satisfies a JSON Schema. It supports const / enum / default / examples literals, local $ref resolution (definitions / $defs), allOf / oneOf / anyOf composition, and semantic placeholders for formats such as email, date, UUID and URL, with recursion protection for circular references.
How to use it
- 1
Paste a JSON Schema
Paste the schema into the input, or click "Fill example"; an invalid schema highlights the error inline.
- 2
Choose whether to include optional properties
By default optional properties (not in required) are generated too, for a fuller example; turn it off to see only the required structure.
- 3
Pause to generate
About 400 ms after you stop typing, an example JSON is generated in the Worker, and a monotonic sequence discards stale results.
- 4
Copy or adjust in reverse
Copy the result; adjust schema constraints and regenerate, or infer a schema from existing JSON, all on the same page.
Key features
Literals take priority
When the schema declares const, enum, default or examples, those values are used directly so the example matches the author intent.
Local $ref resolution
Supports #/definitions/* and #/$defs/* pointer references including ~0 / ~1 escaping, with recursion-stack protection against circular references.
Composition keywords
allOf merges the branch results (taking the union of object properties), while oneOf / anyOf use the first branch to generate the example.
Semantic format placeholders
email produces an email-style value, date-time an ISO timestamp and uuid a standard UUID, with uri, hostname, ipv4 and more getting realistic placeholders.
Arrays and optional properties
Recognises tuple-form items; minItems fills in example elements (up to 5); optional properties can be toggled wholesale.
Generated in a Worker
Generation runs on a separate Worker thread so the main interface never blocks, and a schema change shows a new result right away.
Common errors & troubleshooting
- ! $ref only supports local pointers within the document (starting with #); cross-file or network references cannot be resolved and output null for those nodes.
- ! A circular-reference schema is not expanded forever — entering the same $ref a second time outputs null, which you can replace with a concrete example by hand.
- ! A false schema (boolean false, meaning no data is accepted) cannot produce an example and is reported; a true schema generates an empty object.
- ! minItems only affects the example element count (at most 5 to keep the document short); fine-grained constraints such as pattern and maximum are not fully reflected.
Frequently asked questions
Will the generated JSON always pass the original schema?
In the vast majority of cases yes: type, required, const, enum and format placeholders are generated according to the schema. A few fine-grained constraints (pattern regexes, numeric ranges beyond minimum, cross-field dependencies) are not fully reasoned about and use generic placeholders, so validate once with the schema validator before relying on it.
Which JSON Schema versions are supported?
It follows draft-07 semantics and is compatible with equivalent keywords in draft 2019-09 / 2020-12 ($defs, type, const and so on). Boolean schemas, $ref and allOf/oneOf/anyOf are supported; newer keywords such as prefixItems and unevaluatedProperties are not specially handled.
What about $ref in the schema?
In-document references (#/definitions/..., #/$defs/...) are resolved to the corresponding sub-schema and then generated; pointers support ~0 and ~1 escaping. Circular references are terminated with null rather than hanging the page. External URL references are not fetched, because the site is zero-network by design.
Is my schema uploaded when generating?
No. The generation logic runs in a Web Worker in your browser; the site has no backend service, so the data never leaves your device — you can confirm this in the Network panel.
Related tools
JSON to JSON Schema
Infer a JSON Schema from a sample JSON document, merging similar fields and marking required properties.
JSON to Java
Generate Java POJOs from JSON with fields, getters/setters and type inference. Choose Jackson, Lombok + Jackson or a plain POJO, and set a custom package name. Runs locally in a Web Worker.
JSON to TypeScript
Generate TypeScript interface or type definitions from a sample JSON payload.
JSON Formatter
Format, beautify and validate JSON in your browser. Errors point to the exact line and column, and you can indent with 2 spaces, 4 spaces or a tab.