JSON to JSON Schema
Paste a JSON sample to get its JSON Schema: field types, required fields and formats like email, date-time or URL. Pick Draft 2020-12 or Draft-07.
How to generate a JSON Schema from JSON
- Paste a JSON sample on the left or open a .json file; the schema appears on the right.
- Pick the version (2020-12 or Draft-07), how required fields are chosen and options such as blocking extra fields.
- Copy or download the schema; pick several files at once to get a schema for each.
Frequently asked questions
It describes what JSON data must look like: which fields it has, their types and which are required. It is used to check data sent to an API, config files or forms before they are processed.
2020-12 is the latest version. Pick Draft-07 when the tool or library you use only understands the older one — the schema made here is the same in both apart from the $schema line at the top.
"In every item": a field missing from some objects in an array is not required. "All fields": every field is required, so the sample itself fails if one of its objects lacks a field. "None": only types are checked.
It adds additionalProperties: false to every object, so data with a field that is not in the sample is rejected. Turn it off if real data may carry more fields.
When every value of a field has the same form: email, date (2026-10-08), date-time (2026-10-08T09:30:00Z), UUID, IPv4 address or web link. A single value of another form makes it a plain string.
A field with only whole numbers is integer; one decimal value such as 9.5 makes it number. An empty array has nothing to learn from, so its items are left open — paste a sample with data.
It is completely free and needs no sign-up.
Related tools
JSON Schema validatorCheck whether JSON data matches a JSON SchemaJSON to TypeScriptGenerate TypeScript interfaces from sample JSONJSON FormatterFormat, minify and validate JSONJSON to ZodGenerate a Zod schema from a JSON sampleJSON to Go structGenerate Go structs from a JSON sampleJSON to Python dataclassGenerate dataclasses or Pydantic models from JSONJSON to Java classGenerate Java classes or records from JSONJSON to Kotlin data classGenerate Kotlin data classes from a JSON sampleJSON Escape / UnescapeTurn text into a valid JSON string and back