JSON Schema Generator
This tool reads a JSON sample and writes a JSON Schema for it. You choose the draft, whether to list required fields, and whether to add formats, examples and a ban on extra properties.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use JSON Schema Generator online
- Paste a JSON sample. One object or a list.
- Pick the draft. Match your validator.
- Set required, formats and examples. Turn each on or off.
- Copy the schema. Or save it as a file.
Why use this free JSON Schema Generator
- Four drafts
- Required lists
- Formats for dates, emails, URLs, UUIDs
- Examples from the sample
- Optional extra-property ban
- Merges many samples
From sample to schema
A JSON Schema describes what valid data looks like, and tools such as editors, API gateways and form builders can use it. Writing one by hand is slow. This page walks the sample, records the type of every value, and writes the schema. Several objects in a list are merged into one description.
Choose the draft
Schemas are written against a numbered draft, and tools support different ones. The page can write 2020-12, 2019-09, draft-07 and draft-04. The only difference in the output is the schema line at the top, so check that your validator accepts the draft you pick.
Required, optional and extra
With the required option on, every key that is present in all samples is listed as required. Keys that are missing from some samples are left out of that list. You can also forbid extra properties, which makes the schema strict about keys it has not seen.
Formats and examples
Text that looks like a date, a date and time, an email, a web address or a UUID gets a format keyword. The sample values can be added as examples. Format words are hints in some validators and enforced in others, so read the notes of your own tool.
What it cannot know
One sample cannot tell the allowed range of a number, the length of a text or a fixed list of values. Add minimum, maximum, enum and pattern by hand. Test the schema against real data, including cases that should fail.
Using the tool
As you type in the JSON Schema Generator, the result appears at once. Undo and redo step back through your earlier text.
JSON Schema Generator: frequently asked questions
Is the output valid JSON Schema?
Why are whole numbers shown as integer?
Can I give it more than one sample?
Does it write the title and description?
Is the JSON sent anywhere?
Does the JSON Schema Generator keep a copy of my text?
Is there a way to reuse the JSON Schema Generator result?
Related searches for JSON Schema Generator
- JSON Schema Generator online
- free JSON Schema Generator
- JSON Schema Generator online free
- JSON Schema Generator for mobile
- JSON Schema Generator without sign up
- JSON Schema Generator – Developer & Web Tools
JSON Schema Generator is a free online tool on MAITBOX, in the Developer & Web Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.