JSON Schema Validator
Validate a JSON document against a JSON Schema and see exactly which rule failed, and where.
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
JSON to JSON Schema
Infer a JSON Schema (2020-12) document from a JSON example.
LocalJSON Formatter & Validator
Format, validate and measure JSON, with errors located by line and column.
LocalJSON Diff
Compare two JSON documents and see what actually changed, independent of formatting.
LocalOpenAPI Structure Checker
Check an OpenAPI document for the fields it needs to describe a real API — not full spec compliance.
LocalDocker Compose Validator
Check a Compose file for the mistakes that stop it loading — before you find out with docker compose up.
LocalKubernetes Manifest Validator
Check one or more Kubernetes manifests for the fields each kind cannot function without.
Local