About this tool
Writing a JSON Schema by hand is tedious. Paste one or more sample documents and this tool infers types for every property, merges the shapes of all items in arrays, marks keys that appear in every sample as required, and detects common string formats such as date-time, email, URI and UUID. Use the result as a starting point for API validation, OpenAPI specs or form generation. Everything is generated locally.
How to use JSON Schema Generator
- Paste sample JSON, ideally an array with several typical records.
- Choose the draft version and options.
- Review the generated schema and tighten it where needed.
- Copy it or download schema.json.
Frequently asked questions
Why is a key not marked as required?
It was missing from at least one of the sample objects. Add more representative samples, or edit the required list by hand.
How are mixed types handled?
If a property holds different types across samples, the schema lists all of them, for example "type": ["string", "null"]. Integers and decimals together become number.
Is the schema final?
Treat it as a draft. Inference can only describe the samples it saw, so add constraints like minimum, maxLength or enum yourself.