How it works
How to use the JSON Schema Generator
Paste sample JSON
The more representative the sample, the better the schema. Arrays of objects are merged to find optional fields.
Tune the options
Pick the draft, how "required" is decided, whether to detect formats, and whether to forbid extra properties.
Refine and use
Copy the schema into your validator, OpenAPI spec or form library and add constraints like minimum or pattern.
How the schema is inferred
Every value in the sample is analysed. Objects in the same array are merged, so a property missing from some items is not marked as required. Numbers that are always whole become integer. Mixed types become type unions (e.g. ["string", "null"]). Strings that look like dates, emails, URLs, UUIDs or IPv4 addresses get a format.
Built for developers
Why developers use it
Private by design
Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.
Instant results
Output updates as you type, with precise error locations when something is wrong.
Works offline
Once loaded, the tool keeps working without a connection. Install it as an app if you like.
Free, no sign-up
No accounts, no limits, no watermarks.
FAQ
Frequently asked questions
Which JSON Schema draft should I choose?
Draft 2020-12 is the current version and is supported by modern validators like Ajv 8. Choose draft-07 for older tooling and many OpenAPI 3.0 setups.
Can I validate JSON against the generated schema?
The generated schema works with any standard JSON Schema validator. Review it first: a sample cannot reveal every constraint your data should obey.
Is my data uploaded anywhere?
No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.
Keep going
Related tools
- XML to JSON SchemaGenerate JSON Schema from XML
- JSON ↔ TypeScriptGenerate TypeScript interfaces from JSON (and back)
- JSON to PythonGenerate Python classes from JSON
- JSON to GoGenerate Go classes from JSON
- JSON ↔ JavaGenerate Java POJOs, Lombok classes or records from JSON
- JSON ↔ C#Generate C# classes or records from JSON (and back)
- Random JSON GeneratorGenerate realistic fake JSON data
- JSON FormatterFormat, validate and explore JSON