Skip to content

JSON Schema Generator

Infer a draft-07 JSON Schema from a sample document in one step.

Quick Tool Overview

The JSON Schema Generator infers a draft-07 schema from one sample document: types for every field, a required list, nested definitions, and detected string formats such as email, date-time, uuid and uri.

What it does
Writes a JSON Schema from a sample document
You give it
One representative JSON payload
You get back
A draft-07 schema with types, required fields and formats
Best for
Documenting an API you did not design, and contract testing
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the JSON Schema Generator

Writing a JSON Schema by hand for an API you did not design is slow and error-prone. Paste one real response instead and the generator writes the schema: types for every field, a required list, nested object and array definitions, and detected string formats.

Format detection is what makes the output immediately useful. A value that looks like an email, a date, a date-time, a UUID, a URI, a hostname or an IP address is annotated with the matching format keyword. Arrays are handled by describing every element and merging the descriptions, so an array of slightly different objects produces one schema covering all of them, with the keys that are not always present left out of required.

Key features of the JSON Schema Generator

String formats detected

Values that look like an email, date, date-time, uuid, uri, hostname or IP address are annotated with the matching format keyword.

Arrays are merged, not sampled

Every element is described and the descriptions combined, so an array of slightly different objects produces one schema covering all of them.

Honest required lists

A key missing from any element of an array is left out of required automatically, rather than being asserted from the first record.

Strictness is a choice

Turn additionalProperties off to catch typos, or leave it open so an upstream API adding a field does not break your validation.

Draft-07 output

The draft with the widest library support, so the schema works in almost any validator without configuration.

How to use the JSON Schema Generator

  1. 1

    Paste a sample document

    One real response is enough; a representative one produces a better schema.

  2. 2

    Set the options

    Choose whether to emit a required list, detect string formats and forbid additional properties.

  3. 3

    Review the schema

    Check that optional fields really are optional and that inferred formats match your intent.

  4. 4

    Copy or download

    Take the schema to your clipboard or save it as a .json file.

Frequently asked questions

Draft-07, declared in the $schema keyword. It is the draft with the widest library support, and most validators accept it without configuration.

Reviews of the JSON Schema Generator

What people who use the JSON Schema Generator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the JSON Schema Generator. It takes half a minute and no account.

Write the first review

More developer tools