Validate JSON against a JSON Schema, draft 3 to 2020-12
Paste your JSON and its schema to see whether it fits, and if not, every problem at its place in the JSON.
How to use it
Paste the JSON on the left and the JSON Schema on the right, or open a file on each side. Leave Draft on Auto to use the schema’s "$schema", or pick a draft. Read the problems; click one to select its line in the JSON. Copy report copies them all.
Examples
A value outside an enum, and a key the schema doesn’t allow
JSON: {"plan": "pro", "region": "eu"}
Schema: {"properties": {"plan": {"enum": ["free", "team"]}}, "additionalProperties": false}$.plan line 1, column 10 Should be one of ["free","team"] $.region line 1, column 27 "region" isn’t one of the properties allowed here
Each problem names the value by its path and its place, so you can find it in a long file.
A required property missing in a nested object
JSON: {"user": {"name": "Ada"}}
Schema: {"properties": {"user": {"required": ["email"]}}}$.user line 1, column 10 Missing the required property "email"
What it checks
What it doesn’t do
It doesn’t download schemas: a "$ref" to a URL outside the schema is named as a problem. Put the schema it points to under "$defs" and point to "#/$defs/…". "$dynamicRef" is read like a plain "$ref", and the page says so when a schema uses it. Numbers with more digits than a JavaScript number keeps are checked rounded, and the page says how many. Draft 3 is checked with its own rules: "required": true inside a property, "extends", "disallow", "divisibleBy", "any" and schemas in "type", and "$ref" replacing the keywords beside it. Drafts 2 and older are refused, with a message saying so. Up to 1,000 problems are listed; the count above the list is exact.
Questions
- Why does "format": "email" pass here but fail elsewhere, or the other way round?
Since draft 2019-09, "format" is only a label unless a validator is told to check it, so validators differ. This page checks it, and when a format fails under 2019-09 or 2020-12 it says that other validators may accept the value. - Can I validate against a schema that uses $ref to another file?
Only to parts of the same schema ("#/$defs/address"). Copy the other schema under "$defs" and point to it there; the page fetches nothing. - Why does it say the schema box holds data?
The right side has no schema keyword (type, properties, required…), so it looks like JSON data rather than a schema. Check that the JSON and the schema are in the right boxes. - Is my data uploaded?
No. Everything runs in your browser, so your JSON and schemas stay on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. API payloads and configs often hold keys, and the page warns you if it spots one.