JSON Schema Generator

Paste a sample JSON payload — get a valid, ready-to-use JSON Schema with inferred types, format detection, and required fields.

Advertisement

How type inference works

The generator walks your sample recursively. Each value becomes a schema node: string, integer, number, boolean, null, object, or array. Nested objects and arrays are expanded in full. When an array mixes item shapes, the item schema uses anyOf; when every item is an object, their properties are merged and only keys present in all items stay required.

Format detection

With format detection on, string values are tested against common patterns and annotated: ISO 8601 timestamps get format: "date-time", plain dates get "date", and emails, URLs, UUIDs, and IPv4 addresses get their matching formats. This turns a hand-written schema you would have typed for ten minutes into a one-click starting point you can drop into Ajv, Python jsonschema, or an OpenAPI components/schemas section.

FAQ

What is JSON Schema?
JSON Schema is a vocabulary for describing the shape of JSON data: which properties exist, their types, which are required, and constraints like formats or ranges. Validators (Ajv, Python jsonschema, OpenAPI tooling) use it to check that incoming data matches the expected structure.
How does the generator infer types from my sample?
It walks your JSON recursively: strings, integers, numbers, booleans, nulls, objects and arrays each map to a schema node. Common string formats (ISO dates, emails, URLs, UUIDs, IPv4) are detected and annotated with the matching format keyword, and every non-null property is marked required unless you turn that off.
Draft 2020-12 vs Draft-07 — which should I pick?
Draft 2020-12 is the current standard and works with modern validators and OpenAPI 3.1 tooling. Draft-07 is older but still required by some legacy systems and older Ajv setups. The generated structure is the same either way; only the $schema identifier differs.
Is my JSON uploaded anywhere?
No. Schema generation runs entirely in your browser with JavaScript. Nothing you paste leaves your machine, so it is safe to use with real API payloads and proprietary data.
Advertisement