JSON Schema Generator
Paste sample JSON and get a JSON Schema for it. More data tools
Generate a JSON Schema from sample JSON
The generator reads your sample and writes a schema with types, nested objects, array item types and required keys. Where array items differ, keys that are missing from some of them stay optional, and values that are sometimes null become nullable.
It also detects string formats such as date-time, date, email, uri and uuid. Pick the draft you need: 2020-12, 2019-09, draft-07 or draft-04.
Features
- Live: the result updates while you type.
- Clear errors: the line, the reason and, where possible, a one-click fix.
- Open and drop files, copy or download the result, and share your input as a link.
- Send to another tool: pass the result straight to a related tool.
- Private: Everything runs in your browser. Your data is not uploaded to any server.
Related data tools
- JSON Validator: Paste JSON to check it. If something is wrong you see the line, the reason and a one-click fix. Nothing is uploaded.
- JSON Minifier: Paste JSON and get the smallest valid version. You see how many bytes you saved.
- JSON Stringify: Convert JSON to an escaped one-line string for your code, or turn an escaped string back into readable JSON.
- Sort JSON Keys: Put every object key in order, at all levels. Great before comparing or committing JSON.
- JSON Tree Viewer: See JSON as a tree you can expand, search and copy paths from.
- JSON Compare: Paste two JSON documents and see exactly what was added, removed or changed.
- All DataMint tools
Frequently asked questions
Is the schema perfect?
It is a strong starting point built from one sample. Review limits such as minimum, maximum and patterns yourself.
Which draft should I use?
2020-12 is current. Many tools still expect draft-07, which is also available.
Is my data private?
Everything runs in your browser. Your data is not uploaded to any server. You can even use the tool offline once the page has loaded.