Tools / JSON Schema Validator

JSON Schema Validator.

Validate JSON against a JSON Schema (draft 2020-12) and see every error with its JSON Pointer.

Runs in your browser

In 2020-12 format is only an annotation. Turn this on to check email, date-time, uuid, ipv4/ipv6, uri, hostname and more.

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Result
Errors

About JSON Schema Validator

The JSON Schema Validator checks a JSON document against a schema and lists every violation with the JSON Pointer of the failing value (for example /items/1/qty), the keyword that failed, the path to that keyword in the schema and a plain-English message. It implements the core of JSON Schema draft 2020-12: type, enum, const, numeric limits including exclusiveMinimum and multipleOf, string length counted in Unicode code points, pattern, array keywords from prefixItems and items to contains, minContains and uniqueItems, object keywords such as required, properties, patternProperties, additionalProperties, propertyNames, dependentRequired and dependentSchemas, the combinators allOf, anyOf, oneOf, not and if/then/else, and the annotation-based unevaluatedProperties and unevaluatedItems. References work with $ref, $defs, $id, $anchor and $dynamicRef inside the schema you paste. For example, an order with "qty": 0 fails exclusiveMinimum: 0, an extra "gift" property fails additionalProperties: false, and a SKU in lower case fails its pattern; all three are reported at once rather than one at a time. Typical mistakes the tool helps with are forgetting that additionalProperties does not see properties declared inside allOf (use unevaluatedProperties instead), expecting format to reject bad e-mails (in 2020-12 it is only an annotation unless you switch on format assertion), and writing draft-07 tuple syntax "items": [ … ], which is still accepted here as prefixItems. Remote references to other URLs are not fetched, because the page makes no network requests. Both the schema and the data stay in your browser.

How to Use

  1. Paste your JSON Schema on the left and the JSON to check on the right.
  2. Turn on format assertion if you want email, date-time or uuid checked.
  3. Read the errors table; each row points at the failing value and keyword.

Frequently Asked Questions

Which drafts are supported?

Draft 2020-12 rules are used for every schema. Most draft-07 and 2019-09 schemas validate the same way; draft-07 tuple items and additionalItems are understood. The detected $schema is shown in the result.

Why does an invalid e-mail pass?

In draft 2020-12, format is an annotation by default, so validators are not required to check it. Switch on "Treat format as an assertion" to check email, date-time, date, time, duration, uuid, uri, hostname, ipv4, ipv6, json-pointer and regex.

Can the schema reference other files?

Only references inside the pasted schema are resolved ($ref to #/$defs/…, $anchor or a sub-schema $id). The page does not download remote schemas.

Is my data uploaded?

No. Validation runs in your browser and nothing is sent to a server.

Related Tools