JSON Schema Generator
Infer a JSON Schema from sample data: every setting below actually changes the output.
Settings
About JSON Schema Generator
Infer a JSON Schema directly from a sample JSON payload instead of hand-writing one. Choose your draft version and every setting (required fields, additional properties, format detection, examples) actually changes the generated output.
How to use it
- Paste a representative sample of your JSON into the input.
- Choose a draft version: 2020-12 (latest), 2019-09, or Draft-07.
- Toggle Require all fields, Allow additional properties, Detect string formats, and Include examples as needed.
- Copy or download the generated schema.
Common use cases
- Documenting the shape of an API response
- Generating a starting schema for request validation
- Bootstrapping a JSON Schema from a real example instead of writing one by hand
FAQ
Which JSON Schema draft versions are supported?
2020-12 (the latest), 2019-09, and Draft-07.
Can it detect formats like email or date automatically?
Yes, when "Detect string formats" is enabled it infers common string formats from your sample values.
Does this also generate a TypeScript interface?
No — this generates a JSON Schema, not a TypeScript type. For a TypeScript interface from the same JSON, use the Export menu on the JSON Formatter instead.