JSON to JSON Schema Generator
Paste a JSON sample, get a draft 2020-12 JSON Schema that describes it: types, required fields, nested objects, array shapes, and string formats inferred automatically. The output validates back through our Schema validator in one click.
How to use this tool
Paste a JSON sample into the left box — a real API response or a config file works best. The schema regenerates as you type.
Every key present in the sample becomes a required property, with additionalProperties set to false so typos in payloads are caught.
Integers, floats, booleans and nulls are typed precisely; nested objects recurse; arrays collapse their elements into a single items schema (heterogeneous arrays become a oneOf).
Well-known string shapes get format hints — email, date, date-time, uri, uuid. Arrays of a few repeated strings are emitted as an enum.
Copy the schema, or take it straight to the Schema validator tab in the main editor to check your other payloads against it.
Frequently asked questions
Is the generated schema a guess or a contract?
A shape sketch of your sample, and a good starting contract: types and required keys come straight from the data, so validation is strict out of the box. Relax anything (make a key optional, widen a format) once real traffic tells you the truth.
Which JSON Schema draft is this?
Draft 2020-12, the current standard. The emitted document declares $schema explicitly and works with ajv 8, most CI validators, and OpenAPI tooling.
What happens to empty arrays?
An empty array carries no shape information, so its items schema is left permissive ({}). Feed in a sample with one element and the real shape appears.
Can it infer enums?
For arrays of strings with at most five distinct values, yes. Per-field enums from a single sample would just echo the sample back, so we leave that judgment to you.
Is my sample uploaded?
No. Inference runs entirely in your browser tab — a schema describing a private API response never leaves your machine.