JSON Schema Generator

Paste a sample document to get a starting JSON Schema. Review it afterwards, because one example can't show every allowed value.

JSON Schema Generator

Developer Tools

Runs locally in your browser.

Runs locally in your browser — your JSON is never uploaded.

About the JSON Schema Generator

Creating a JSON Schema to validate API responses or user input is a time-consuming and error-prone process. You need to remember all the schema syntax rules, spend hours defining individual data types, and make sure that your nested objects and arrays match the required structure.

With this JSON Schema Generator, you can automatically generate a schema from any sample JSON document with a few simple clicks. The created schema will instantly recognize all the data types and nested structures in your input data. The comparison runs in your browser, which matters when the data is sensitive.

Key Features of JSON Schema Generator

  • Quick starting pointYou don't have to write every validation rule by hand. This tool can automatically analyze any sample JSON document and accurately determine all the data types.
  • Draft 2020-12 complianceThe generated schema will always be valid according to the JSON Schema specification draft 2020-12, so it will perfectly validate your data.
  • Customizable propertiesYou can easily customize your schema by adding a descriptive title and selecting which properties should be required.
  • 100% local processingAll schema generation operations take place locally in your browser. Your privacy is guaranteed since no data is ever sent to external servers.
  • Instant file exportYou can also immediately export your schema to a file once it is created. Or simply copy the generated JSON Schema to your clipboard.

How to Use JSON Schema Generator

  1. To use the JSON Schema generator, simply enter your sample JSON document, add a title to your schema, select which properties should be required, and click the "Generate schema" button. Then, you can use the "Copy" or "Download" buttons to save your schema.

JSON Schema Generator Examples

A starting schema inferred from one sample. Every key seen is marked as required, so relax that if some are optional.

Input
{"id":7,"email":"[email protected]"}
Result
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Generated Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "email": {
      "type": "string",
      "format": "email"
    }
  },
  "required": [
    "id",
    "email"
  ]
}

JSON Schema Generator — Frequently Asked Questions

What is a JSON Schema?
A JSON Schema is a standardized format for describing and validating JSON data formats. It defines a set of rules that must be followed by a JSON document. JSON Schema is often used to validate user input, API responses, or other data formats.
What is 2020-12?
Draft 2020-12 is a specification of the JSON Schema language that defines keywords, structural rules, and validation rules for JSON documents.
Is it possible to process private API data through this service?
Yes, it is completely safe to use this service to process your private API data. Data processing happens entirely locally in your browser.