Menu
PDF Tools
Image Tools
Converters & Utilities
Seller & Print Tools
Accounting & Business
Calculators
Text & Writing Tools
Developer & Web Tools
Creator & Social Tools
Browser Utilities & Games
Document & Design Makers
Text & Developer Tools
Exam & Form Tools

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.

How to use JSON Schema Generator online

  1. Paste a JSON sample. One object or a list.
  2. Pick the draft. Match your validator.
  3. Set required, formats and examples. Turn each on or off.
  4. 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?
It is plain JSON that follows the keywords of the chosen draft. Run it through your own validator to be sure.
Why are whole numbers shown as integer?
The sample value had no decimals. Switch the option off to write number instead.
Can I give it more than one sample?
Yes, put the samples in a list and they are merged.
Does it write the title and description?
It writes a title if you type one. Descriptions are left for you.
Is the JSON sent anywhere?
No. The sample is read in your browser.
Does the JSON Schema Generator keep a copy of my text?
It stays in your browser tab; the JSON Schema Generator sends nothing anywhere.
Is there a way to reuse the JSON Schema Generator result?
Yes. Copy the JSON Schema Generator result, or press Use result as input and carry on with the new text.

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.

More tools in Developer & Web Tools →

Search tools