JSON Schema Generator
Paste any sample JSON object and instantly generate a JSON Schema (draft-07) that describes its structure. Infers types, nested objects, arrays, and required fields. Copy or download the schema. Everything runs in your browser — your data never leaves your device.
About this tool
The JSON Schema Generator analyses a sample JSON document and automatically produces a
JSON Schema draft-07
that describes its structure. It infers the correct JSON Schema type for every value — string, number,
integer, boolean, null, object, and array — and recursively
walks nested objects and arrays. All top-level keys on objects are added to the required array, giving you a strict
starting schema that you can then relax as needed.
Why draft-07?
JSON Schema draft-07 is the most widely supported version across popular validators and tooling. It is the default target for
libraries such as Ajv (JavaScript),
jsonschema (Python),
justinrainbow/json-schema (PHP),
and many code-generation and documentation tools. Draft-07 added if/then/else keywords and
readOnly/writeOnly annotations, making it significantly more expressive than earlier drafts.
How to use the generated schema
- Paste your schema into jsonschemavalidator.net to validate live data against it.
- Use it with Ajv in Node.js/browser projects for fast runtime validation.
- Feed it to tools like quicktype to generate typed models in TypeScript, Go, Rust, and more.
- Add it to your OpenAPI spec under the
components/schemassection.
The generated schema is a starting point — review it before use. Especially check required fields (not every field
may truly be required in your real data) and consider adding minLength, minimum, format,
or enum constraints where appropriate.