JSON Schema Validator

Validate JSON against a JSON Schema: every error at once with its path, line and a hint. Catches field name typos and schema mistakes, drafts a schema from a sample.

Your data and schema never leave this page: parsing and validation run in your browser. The draft version is taken from the $schema field; if it is missing, 2020-12 is used.

What gets checked

Both fields are first parsed as JSON, and a parse error comes back with the line, column, and a hint: single quotes, a trailing comma, an unquoted key, a comment. Then the document is validated against the schema, and all errors are collected, not just the first one.

Each error carries a path to the value such as /items/1/price, the line number in the document, and an explanation of what is wrong: "expected a number, but here is the string "12500.50" — the number is wrapped in quotes, remove them".

Typos in field names

The most common cause of a "missing required field" error is a field that exists but is spelled slightly differently: custmer instead of customer. When a required field is missing but a similar one sits nearby, the validator names it. The same works for enum values: "Paid" instead of "paid" differs only in case, and the message says so.

Errors in the schema itself

A schema can be wrong too, and then validating a document against it makes no sense. An unknown type, a regular expression that cannot be read, a $ref pointing nowhere, minimum greater than maximum, required not given as a list — all of this is reported in a separate list, and the document is checked against the part of the schema that does read.

Drafts of the standard

Draft-04, draft-06, draft-07, 2019-09, and 2020-12 are supported. The draft is taken from the $schema field or chosen manually: it determines how items, prefixItems, exclusiveMaximum, and $ref are read.

What is not checked is listed in the caveats: unevaluatedProperties, $dynamicRef, references to other files, and rare formats. Everything else is checked.

A schema from your document

If you do not have a schema yet, a button builds its draft from your example: value types, nested objects, fields shared by array elements, date and email formats guessed from how the strings look. Every field from the example becomes required — it is a starting draft to refine, not the truth.

JSON Formatter

To turn a compact JSON document into a readable one, use JSON Formatter.

Rate this tool

Help us get better

Other tools