Generate a JSON Schema from a sample JSON document, with types and required keys
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.Writing a schema by hand for a large API response is slow. Paste a sample and get a 2020-12 schema back: every property typed, integers told apart from decimals, arrays of records merged so a key is required only when every record has it, and extra properties refused. Then tighten it by hand, adding formats, ranges and enums, and test real data against it in the Validate tab.
Paste a representative JSON sample into the Data pane; arrays with several records give the best result.
Check that Generate schema is selected; the schema appears in the Schema pane.
Edit the schema to add formats, minimums, maximums or enums that the sample cannot show.
Click Copy, or switch to Validate to test other documents against it.
JSON Schema is the standard way to describe what valid JSON looks like, used by OpenAPI, form builders, config files and data pipelines. Paste a schema and a document, and the result updates as you type.
What is checked. Every assertion in the validation vocabulary: type, enum, const, number limits and multipleOf, string length and pattern, array length, uniqueItems, contains, object size, required, dependentRequired, and the applicators properties, patternProperties, additionalProperties, items, prefixItems, allOf, anyOf, oneOf, not and if/then/else. References with $ref follow JSON pointers, $defs, definitions, $id and $anchor inside the schema.
Generate a schema. Paste a sample instead, and a starting schema is written from it, ready to tighten.
The rest of the article, and all 6 questions about JSON Schema Validator, are on the JSON Schema Validator page.
Paste the schema into the Schema pane and the JSON document into the Data pane. The result appears at once: Valid, or a list of errors, each naming the path of the bad value, such as /items/2/price, and the rule it broke, such as minimum 0. Fix the data or the schema and the list updates as you type.
Use 2020-12 for new schemas: it is the current specification and what OpenAPI 3.1 uses. Draft 7 remains common in older tools and libraries. Declare the version in $schema, for example https://json-schema.org/draft/2020-12/schema, because array tuples, $ref and dependencies behave differently between versions.
required names the exact properties that must be present, such as id and email, while minProperties only counts them: minProperties 2 accepts any two keys. A property listed in properties but not in required is optional, and when present it must still match its own schema.
Yes. Switch to Generate schema and paste a sample in the Data pane: a 2020-12 schema is written with every property typed and the keys present in all records marked required. A sample cannot show limits, formats or allowed values, so add minimum, format and enum by hand before relying on it.
Rates and rules change; check the source before you rely on a figure.
Still stuck? Ask about JSON Schema Validator and anybody who knows can answer. No account needed.
On the related tools: Readability Checker – Flesch reading ease and grade level, with what to change · JSONPath Evaluator – Evaluate a JSONPath expression and get the matching values and their paths.