Tools
EN

JSON Schema Generator

Paste an example JSON document and get a JSON Schema that describes it – types, required properties, nested objects and arrays, and string formats such as email, date-time or UUID.

Sample JSON

JSON Schema

Private: your data is processed in your browser and never uploaded.

How to generate a JSON Schema

  1. Paste a representative JSON example. Arrays with several items give the best results, because their items are merged into one schema.
  2. Choose the schema version (draft 2020-12 or draft-07) and whether properties should be required, formats detected and extra properties disallowed.
  3. Copy or download the schema, then refine it by hand – for example add descriptions, enums or minimum and maximum values.

What the generator infers

JSON exampleSchema
"ada@example.com"{"type": "string", "format": "email"}
"2026-05-01T10:00:00Z"format date-time (also date, time, uri, uuid, ipv4)
42 / 4.5"integer" / "number"
a key present in every objectlisted in required
a key missing in some array itemsoptional (not in required)
[1, "a", null]"items": {"type": ["string", "integer", "null"]}
objects mixed with plain valuesanyOf with one schema per kind

What is JSON Schema?

JSON Schema is a vocabulary for describing and validating the structure of JSON data: which properties exist, what type each one has, which are required and which values are allowed. It is used for API contracts in OpenAPI, configuration files, form generation and validating the structured output of AI models. The current version is 2020-12; draft-07 is still supported by many older tools. The specification is published at json-schema.org.

Refining the generated schema

Frequently asked questions

Which JSON Schema version should I use?

Use draft 2020-12 for new projects – it is the current version and the basis of OpenAPI 3.1. Choose draft-07 if your validator or tooling does not support 2020-12 yet.

Why are all my properties required?

With a single example object every property is present, so all of them are marked as required. Use an array with several varied examples, or switch off Mark properties as required.

Can the generator detect enums or ranges?

No. One example cannot show which values are allowed in general, so enums, minimum and maximum values and patterns have to be added by hand.

How do I validate JSON against the schema?

Use a validator library such as Ajv for JavaScript or jsonschema for Python. Many code editors also validate a JSON file against the schema referenced in its $schema property.