● runs entirely in your browser

JSON Schema Generator

Paste a sample JSON document to generate a matching JSON Schema (Draft-07) — types, required fields, and nested structure inferred automatically. Nothing is ever uploaded.

How it works

The generator walks your parsed sample JSON recursively, mapping each JavaScript type to its JSON Schema equivalent (whole numbers become integer, others number) and building a properties object for each nested object it finds. When format detection is on, every string value is tested against a small set of regexes, in order, for email, date-time, date, URI, and UUID shapes, and the first match sets that field's format.

FAQ

What happens if my array has mixed-type items?
The generator only looks at the array's first element to build its "items" schema — it assumes arrays are homogeneous, so a mixed-type array ends up with an items schema based solely on whatever type came first, not one that covers every type actually present.
How does it decide a string field should get "format": "email" or "date"?
It runs that field's one sample value through regex tests for email, date-time, date, URI, and UUID patterns and tags it with the first match — since it only ever sees your single example, a field that happens to look like an email in your sample gets tagged that way even if real-world values wouldn't always match.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks — $3