A JSON Schema generator that turns a real JSON sample into a validation schema in one step. Paste an object or array, and the tool infers the types, required keys, string formats and optional enums, then emits a clean Draft 2020-12 or Draft-07 schema you can copy or download. It is built for developers who need to validate API responses, lock down config files, document a payload, or seed an OpenAPI definition without hand-writing a schema from scratch.
Writing JSON Schema by hand is slow and error-prone — you have to nest properties, track every required array, and remember the exact format keywords. This tool reads a concrete example and does that bookkeeping for you, so you start from a correct draft and only fine-tune the parts that depend on intent (which fields are truly optional, which strings are really enums).
How it works
The generator parses your input locally and walks the value recursively. Every node is mapped to a schema fragment: objects become type: object with a properties map; numbers split into integer versus number; null becomes type: null. Object keys are collected into a required array when “Mark all keys required” is on, and additionalProperties is set to false unless you allow extras.
Arrays get special treatment. With merging enabled, the tool unifies every element into a single items schema — it unions the properties of all objects and keeps a key in required only if it appears in every element, which is exactly what you want for a list of records. Without merging, an array of structurally different elements becomes a tuple (items as an array, one schema per position). Strings are pattern-matched against a small library of formats — uuid, date-time, date, time, email, uri and ipv4 — and primitive arrays with repeated literals can be collapsed into an enum. A live field tree view shows the inferred structure at a glance, with type badges, detected formats and required markers.
Example
Paste this fragment:
{ "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "email": "[email protected]", "age": 36, "roles": ["admin", "editor"] }
The generator produces a schema whose id is a string with format: uuid, email is a string with format: email, age is an integer, and roles is an array of strings. All four keys land in the required array (with the default setting), and additionalProperties is false. Toggle “Detect enums” and a repeated-value array such as ["gold", "silver", "gold"] becomes a string with an enum of its distinct values instead.
| Sample value | Inferred type | Format / note |
|---|---|---|
"[email protected]" | string | |
"2026-05-30T09:24:00Z" | string | date-time |
36 | integer | — |
1240.5 | number | — |
null | null | nullable field |
Everything is computed in your browser — your JSON never leaves the page.