JSON Schema Validator & Draft Generator

Paste a schema and the data to see each place they disagree; Generate turns a sample into a draft schema and proves that the draft accepts it. Nothing leaves the browser.

Runs locally in your browser
JSON Schema

Use a JSON Schema object; references that start with #/ are resolved inside this page.

JSON data

Paste data to validate, or paste a representative sample and generate a starting schema.

Validation result
Enter a JSON Schema and JSON data, then select Validate JSON.

Checks included in this local validator

The checker reads type, enum, const, allOf, anyOf, oneOf, not and if/then/else; properties, patternProperties, additionalProperties, propertyNames, required, dependentRequired, minProperties and maxProperties; items, prefixItems, additionalItems, minItems, maxItems, uniqueItems and contains; minLength, maxLength, pattern and the formats email, uuid, date, time, date-time, uri, uri-reference, ipv4, ipv6 and hostname; minimum, maximum, exclusiveMinimum, exclusiveMaximum and multipleOf; and local $ref values, including references that recurse through the data. The draft-04 boolean form of exclusiveMinimum/exclusiveMaximum and the array form of items are read as well. Every other keyword and format is left alone, so confirm production policy with a conforming validator.

Check a payload against its schema in this tab

The schema and the data stay in the browser; nothing is uploaded. Each issue is listed with the path where it was found, the list stops after 100 issues, and Generate writes a draft schema from your sample and re-checks that sample against it.

How to check JSON against a schema

Paste a JSON Schema and a JSON document to see every place where the data breaks the schema. The check runs in this tab: nothing is uploaded, and the tool keeps working with the network disconnected.

Generate works the other way round. It reads your sample, writes a draft schema — array items merged over every element, required limited to the keys that every object carries — and validates the sample against that draft, so a draft that cannot describe its own sample is reported instead of stored quietly.

  1. Paste the schema into the JSON Schema field and the document into the JSON data field. Local references such as #/$defs/address are followed; a reference that points to another file is reported as unsupported here.
  2. Select Validate JSON. Each problem is listed with the path where it was found, for example $.users[2].email, and with the rule that failed. The list stops after 100 problems and says so.
  3. Select Generate schema from data to build a draft from the sample. The draft replaces the content of the schema field, and the sample is checked against it right away.
  4. Copy schema copies the schema field, Load example fills both fields with a small API payload that passes, and Clear empties both fields and the result box. Editing either field after a result dims the old verdict and asks you to run the check again.

What the checker reads and what it leaves alone

What the checker reads

type, enum, const, allOf, anyOf, oneOf, not and if/then/else; properties, patternProperties, additionalProperties, propertyNames, required, dependentRequired, minProperties and maxProperties; items, prefixItems, additionalItems, minItems, maxItems, uniqueItems and contains; minimum, maximum, exclusiveMinimum, exclusiveMaximum and multipleOf; minLength, maxLength and pattern; and local $ref values, including references that recurse through the data. The draft-04 boolean form of exclusiveMinimum/exclusiveMaximum and the array form of items are read as well.

Format checks cover email, uuid, date, time, date-time, uri, uri-reference, ipv4, ipv6 and hostname. A date such as 2024-02-30 and a time such as 99:99 are rejected because the calendar and the clock are checked, not just the shape of the text; any other format name is left alone. The specification treats format as an annotation, so this page is stricter than a plain reader.

Answers that do not depend on key order

enum, const and uniqueItems compare values structurally: {"a": 1, "b": 2} and {"b": 2, "a": 1} are one value, not two. The previous version of this tool compared JSON text and got both cases backwards — it rejected a valid enum value and accepted a duplicate array member.

minLength and maxLength count code points, so an emoji written as a surrogate pair counts as one character.

Draft schema from a sample

Array items are merged over every element: a mixed array produces an anyOf list, and objects are merged property by property, with required limited to the keys that every object carries. An empty object or an empty array produces no empty required list.

Strings that look like a UUID, an email address, a date, a date-time or a URI get the matching format hint, so the draft is more useful than a bare type — usable for a first pass, not as a contract.

Limits

The issue list stops at 100 entries. Nesting deeper than 4,000 levels stops the check with a message instead of a browser crash, and a circular #/ reference is reported rather than followed forever.

Patterns and formats use the browser's regular expression engine; 20,000 array items or object properties are checked in about 20 ms.

Recent tools: