Validate a JSON document against a JSON Schema and read every failing keyword with the exact path inside the document. The compiler is Ajv, the same validator most Node tooling uses, so a schema that passes here behaves the same way in a CI step or an API gateway.
Schema on the left, document on the right
Paste the schema into the left pane and the document to test into the right one. Both panes parse as you type, and a JSON syntax error shows under the pane it belongs to before any validation runs.
The draft is read from the schema’s $schema field. https://json-schema.org/draft/2020-12/schema selects draft 2020-12, https://json-schema.org/draft/2019-09/schema selects 2019-09, and anything else, including no $schema at all, falls back to draft-07. The Draft selector overrides that detection when you want to see how the same schema behaves under a different version.
Press Load example to fill both panes with a user record schema and a document that fails it in four places.
Reading the error list
Each error is one line in three columns: the instance path, the keyword, and the message.
/ required must have required property 'id'
/email format must match format "email"
/roles/0 enum must be equal to one of the allowed values ["admin", "editor", "viewer"]
/ additionalProperties must NOT have additional properties (nickname)
The instance path is a JSON Pointer into the document. /roles/0 is the first item of the roles array. An empty path, printed as /, points at the root, which is where a missing required property is reported because the object as a whole is incomplete.
With All errors on, the validator keeps going after the first failure and lists everything. Turn it off to stop at the first error, which is how Ajv runs by default in production for speed, and which can hide a second problem behind the first.
Example: a schema that rejects a document
Schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": ["id", "email"],
"properties": {
"id": { "type": "integer", "minimum": 1 },
"email": { "type": "string", "format": "email" }
},
"additionalProperties": false
}
Document:
{ "id": 0, "email": "sam", "nickname": "sam" }
Result: three errors. /id fails minimum because 0 is below 1. /email fails format because sam has no @. The root fails additionalProperties because nickname is not declared. Remove additionalProperties: false and the third error disappears while the first two stay.
Strict mode
Ajv’s strict mode is off by default on this page. On, it refuses to compile schemas that use keywords it does not know, that declare properties without type: "object", or that combine keywords in ways the specification leaves undefined. Those schemas are common in the wild and still validate correctly, so the default keeps them working. Turn strict on when writing a schema from scratch: the compile error points at the ambiguity before it reaches a consumer that interprets it differently.
Formats
format is an annotation in draft 2019-09 and 2020-12, which means a conforming validator may ignore it. With Check formats on, the page enforces the standard set from ajv-formats: date, time, date-time, duration, email, hostname, ipv4, ipv6, uri, uri-reference, uuid, regex, json-pointer, and a few more. A format outside that list fails to compile under strict mode and is ignored otherwise.
Turn the checkbox off to see how the document fares under a validator that treats format as documentation only.
Remote references
A $ref that points at an http or https URL is not fetched. The schema pane reports it as a compile error instead of silently passing the branch. Paste the referenced schema into $defs (or definitions in draft-07) and change the reference to a local pointer:
"address": { "$ref": "#/$defs/address" }
References inside the same document, including recursive ones, resolve normally.
JSON Schema is not JSON-LD
The two are often confused because both contain the word schema. JSON Schema describes the shape of data: which properties exist, their types, their ranges. JSON-LD with Schema.org vocabulary is markup that tells search engines what a page is about. A product feed is validated here. A product rich-result snippet is checked with the JSON-LD Schema Validator.
To go the other way and produce a schema from a sample document, the JSON Schema Generator infers one, which you can then paste into the left pane and tighten.