What is a JSON Schema generator?
A JSON Schema generator infers a schema, a formal description of a JSON document's structure, from example data. JSON Schema is used to validate API requests and responses, document data formats, generate forms and types, and catch bad input before it reaches your code.
Paste a sample to get a draft 2020-12 schema with types, nested properties and array item schemas. Options detect string formats, mark fields as required, forbid unexpected properties, add a title, and treat a top-level array as a set of samples to merge.
How to use the JSON Schema generator
1.Paste sample JSON
One object, or an array of several samples.
2.Pick options
Formats, required fields, extra properties and a title.
3.Copy or download
Save schema.json and refine it.
Example: a user record
One user with id, name, email, age, joined, tags, address and manager:
- id
- string, format uuid
- email / joined
- format email / format date-time
- age / tags
- integer / array of strings
- manager
- type null (add other types if it can be set)
A complete schema in one step, ready to tighten with real limits.
Inference from examples
Every value's type is recorded, objects become nested properties, and arrays get a schema for their items. With several samples, properties found in all of them are marked required, and types that differ are combined, so a field that is sometimes null becomes ["string", "null"].
Format detection recognises strings that are all email addresses, dates, date-times, times, URLs, UUIDs or IPv4 addresses. A generated schema reflects only the samples you gave it, so add limits such as minimum, maxLength or enum by hand where your rules are stricter.
Frequently asked questions
Which draft does it use?
Draft 2020-12, the current version, which most validators support.
How do I give several samples?
Paste an array of objects and tick Treat a top-level array as several samples.
What does disallowing extra properties do?
It adds additionalProperties: false, so unknown keys fail validation.
Is my data uploaded?
No. The schema is generated locally.
Related tools
JSON to TypeScript Interface Generator
Generate TypeScript interfaces or types from a JSON sample.
JSON Formatter & Validator
Pretty-print, minify, sort and validate JSON with line-numbered errors.
JSON viewer
Explore JSON as a collapsible tree, search it and copy paths.
JSON ↔ CSV Converter
Convert JSON arrays to CSV and CSV back to JSON.
JSON ↔ YAML Converter
Convert JSON to YAML and YAML to JSON.
JSON Escape & Unescape
Escape text for a JSON string, or unescape \n, \" and \u codes.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table