JSON Schema Generator
Paste sample JSON and get a ready JSON Schema (Draft 2020-12 or 07): types, required fields, nullable values and formats like email, date and uri, merged across many records.
Free, no sign-up
Your data stays on your device
Works offline after first open
The tool
Loading the tool…
How to use
- Paste sample JSON (more records give a more accurate schema).
- Pick the draft and whether you want required fields and formats.
- If the root is an array of records, you can get a schema for one record.
- Copy the schema or download it as a .schema.json file.
Privacy & how it works
Processes your data in the browser and stores nothing.
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
Frequently asked questions
How are required fields decided?
A field is required when it appears in every record of the sample. If one record lacks it, it becomes optional.
Is the schema final?
It is a starting point built from your sample. Review it and add constraints (like minimum and maximum) that fit your project.
What does “strict” mean?
It adds additionalProperties: false, so any key not listed in the schema makes the data invalid.
Related tools
JSON to TypeScriptTurn sample JSON into ready TypeScript interfaces: names from the keys, records in arrays merged, optional fields for missing keys, plus null and readonly as you choose.JSON Formatter & ValidatorPretty-print JSON or minify it to one line, sort keys alphabetically, validate it with the exact line, column and cause of any error, or escape and unescape JSON strings.JSON Viewer & JSONPath QueryBrowse JSON as a collapsible tree, search keys and values, and pull out what you need with a JSONPath query like $.items[?(@.price > 10)].name, copying any path or value.CSV to JSONConvert CSV or TSV to JSON: an array of objects, arrays or columns, with real numbers and booleans, and nested objects from headers like address.city. Arabic supported.