JSON Schema Generator
Infer a JSON Schema (draft 2020-12) from one or more JSON samples, with types merged and required fields worked out.
Runs in your browser. Files stay on this device.
How to use JSON Schema Generator
- 1Paste a JSON sample, an array of samples, or one JSON document per line.
- 2Pick whether fields found in every sample are required.
- 3Copy or download the schema.
Questions
How are several samples merged?
Every property seen in any sample is listed. A property is marked required only when every sample object has it, and a field that is a number in one sample and null in another gets both types.
When is a field an integer and when a number?
Whole numbers give "integer". If any sample has a decimal there, the field becomes "number", which covers both.
Which formats does it spot?
date-time, date, email, uuid and URI, and only when every string in that field matches the same one. Turn it off if you would rather not have formats.
Is my JSON sent anywhere?
No. The schema is worked out in your browser.
Is it free?
Yes. No account, no watermark and no daily limit.
Related tools
- DeveloperBase64 EncoderEncode text or files to Base64 and decode it back, with URL-safe and data URL options.
- DeveloperDiff CheckerCompare two texts and see what was added and removed, line by line or word by word, and download a patch.
- DeveloperHash GeneratorGet the MD5, SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file, and check it against a hash you were given.
- DeveloperJSON FormatterFormat, check and minify JSON, with the exact line of any error.
- DeveloperJWT DecoderRead the header and claims of a JSON Web Token, see when it expires, and check an HMAC signature.
- DeveloperRegex TesterTest JavaScript regular expressions live: every match highlighted, capture groups in a table, and a replace preview.