JSON Schema generator
Infer a JSON Schema from sample JSON, with types, required keys and item schemas.
Missing a feature or found a bug in JSON Schema generator? Tell me on X (@_andrewtran) or by email.
How to use JSON Schema generator
- Paste a JSON sample in the input pane.
- Read the inferred schema in the output pane.
- Copy it or download it as schema.json, then tighten it by hand.
Questions and answers
Is my data sent anywhere?
No. Everything runs in your browser on this device. Nothing you paste is uploaded or stored.
Which draft does the schema use?
Draft 2020-12. The types, properties, required and items keywords it uses also work in older drafts.
Is the schema complete?
It describes the sample you gave. Formats, value ranges and patterns cannot be guessed from one sample, so add those yourself.
Related tools
JSON flatten and unflatten
Flatten nested JSON to dot-path keys such as user.tags[0], or turn flat keys back into nested JSON.JSON escape and unescape
Turn text into a JSON string literal with quotes and line breaks escaped, or turn one back into text.HTML entity encoder
Escape text as HTML entities, or decode entities such as & and ' back into characters.Text to hex converter
Convert text to hexadecimal UTF-8 bytes, or decode hex back into text.