JSON Schema Validator
Check a JSON document against a JSON Schema and get a precise, per-error report — instancePath, keyword and all.
JSON document
- characters
- 0
- lines
- 0
- size
- 0 B
JSON Schema
- characters
- 0
- lines
- 0
- size
- 0 B
About this tool
Syntax validation tells you whether JSON is well-formed; schema validation tells you whether it means the right thing. A JSON Schema declares the required properties, types, formats, ranges and shapes a document must satisfy, and this tool checks a document against one.
Validation is powered by Ajv, the most widely used JSON Schema engine, running entirely in your browser. It targets Draft 2020-12 and validates Draft-07 schemas in a lenient mode, so real-world schemas compile instead of being rejected for an unfamiliar keyword.
Reading the error list is the skill worth learning. Each entry pairs an `instancePath`, which points into your document, with a `schemaPath`, which points at the rule that rejected it. A `required` error reports the object that is missing a property rather than the property itself, so the instancePath is the parent — that surprises people once and then never again.
Turning "report all errors" off is useful on large documents: Ajv stops at the first failure, which is faster and keeps the list focused while you fix problems one at a time. Leave it on when you want the full picture before editing, for example when checking a payload against a schema you did not write.
How to use this tool
Paste your JSON document into the left editor.
Paste the JSON Schema into the right editor, or load the sample to see the format.
Choose whether to report only the first error or all of them.
Press Validate and work through each error using its instancePath and message.
Key features
- Ajv-powered validation for Draft 2020-12 and Draft-07
- Per-error instancePath, schemaPath, keyword, message and params
- Report the first error only, or every error at once
- Format keywords (email, date, uri, …) via ajv-formats
- Separate, precise syntax errors when either input is not valid JSON
Example
Input — JSON + Schema
{ "id": 1 } // schema requires "name"Output — Report
instancePath: (root)
keyword: required
message: must have required property 'name'Good to know
- Both the document and the schema must themselves be valid JSON first; a syntax error in either is reported before schema checks run.
- Strict mode is disabled so unusual schemas compile; genuinely invalid schemas are reported as compile errors.
Frequently asked questions
Which JSON Schema drafts are supported?
Ajv here is configured for Draft 2020-12, and it also validates Draft-07 schemas in a lenient mode. Very old drafts (4/6) may need adjustment.
What do instancePath and schemaPath mean?
instancePath points to the location in your document that failed; schemaPath points to the rule in the schema that rejected it. Together they tell you exactly what to fix and why.
Is my data or schema uploaded?
No. Compilation and validation run entirely in your browser tab.
Why does a required error point at the parent object?
Because the missing property has no location of its own. The instancePath identifies the object that should have contained it, and the message names the property, so together they pin down the fix.
Do format keywords like "email" actually get checked?
Yes. ajv-formats is enabled, so email, date, date-time, uri, uuid, ipv4 and the other standard formats are validated rather than ignored.
Can it follow $ref to an external schema URL?
No. Remote references are not fetched — that would mean sending a request on your behalf. Inline the referenced definitions with $defs and local $ref instead.
Further reading
How to validate JSON — There are two different questions hiding behind "is this JSON valid": does it parse, and does it match the shape it is supposed to have.
Your data stays on your device
Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.
Related tools
- JSON ValidatorJSON ToolsCheck JSON syntax and get the exact line, column and cause of every failure.JSONReport
- JSON to JSON SchemaJSON ToolsGenerate a JSON Schema that describes the shape of an example document.JSONJSON Schema
- JSON FormatterJSON ToolsPretty-print messy JSON with your choice of indentation and optional key sorting.JSONJSON
- JSON ParserJSON ToolsParse JSON, confirm it is valid, and see it as clean indented output.JSONJSON
- JSON RepairJSON ToolsFix common JSON mistakes — quotes, commas, comments — and get valid output.JSONJSON
- JSON ViewerJSON ToolsBrowse JSON as a collapsible tree, search keys and values, and copy JSONPath.JSONTree