Search tools

Search for a command to run...

JSON Schema Generator

Generate a JSON Schema (draft 2020-12) from sample JSON — types, nested objects, arrays, required fields and formats like email, date-time and URI.

How to use

  1. 1Paste a representative JSON sample — arrays with several items give better results.
  2. 2Copy the schema and refine descriptions, enums and limits by hand.

How it's calculated

Types are inferred from values; objects in an array are merged, and a field is 'required' only if it appears in every sample object.

Frequently asked questions

Which draft is generated?

JSON Schema draft 2020-12, which is supported by modern validators like Ajv and by OpenAPI 3.1.

Why is a field not required?

It was missing from at least one object in an array. Add it to all samples, or edit the 'required' list.

Can it detect enums?

No — a sample can't tell whether a value is one of a fixed set. Add enum lists manually.