Skip to main content
QUIETLYTIC
Developer

JSON Schema Validator

Validate a JSON document against a JSON Schema and see exactly which rule failed, and where.

Local · nothing leaves this browser Waiting for a JSON document and schema
Esc Clear
Esc Clear
Validation result

Paste a JSON document and a schema.

How it works

Validates a JSON document against a hand-written subset of JSON Schema Draft 2020-12: type, enum, const, numeric ranges and multipleOf, string length/pattern/format, array length/items/prefixItems/contains/uniqueItems, object required/properties/patternProperties/additionalProperties/propertyNames/dependentRequired, the combinators allOf/anyOf/oneOf/not, if/then/ else, and in-document $ref such as #/$defs/address.

What isn't checked, and how you'll know

A $ref to another URL is never fetched — nothing you paste leaves the page — and $dynamicRef and unevaluatedProperties/unevaluatedItems are not implemented. Each shows up as a "Not checked" line rather than being skipped silently, so a clean result never claims more than was evaluated.

Patterns that could hang the page are not run

A pattern or patternProperties regex runs synchronously in your browser, and a shape like (a+)+ can backtrack for minutes on a short string. Each pattern is screened with the same analysis as this site's Regex Safety tool first; one with a known catastrophic or polynomial backtracking shape is reported as not checked instead of being executed. That screen cannot catch every slow pattern, so validation also runs in a background worker that is stopped after three seconds, and the page stays responsive either way. A $ref that loops back on itself is reported as not checked too.

Example

The sample schema requires a non-empty name string and a non-negative integer age, with no properties beyond those two allowed. The sample document fails on age being negative — each failure names the exact path (age) and why it failed, not just "invalid".

Frequently asked questions

How is this different from JSON → JSON Schema, already on this site?

That tool goes the other direction — it infers a schema from one example document. This one validates a document against a schema you already have (hand-written, or generated by that tool, or from a spec you are implementing against).

Why does the error path use dots and brackets like user.tags[2]?

It mirrors how you would actually address that value in code — object properties with a dot, array indices with brackets — so the path can be pasted straight into a debugger or a console.log without translation.

Related tools

From the intelligence desk