Developer tools · Validators
JSON Schema validator.
Paste a JSON Schema and a JSON document to check the document against the schema. Draft-07, 2019-09 and 2020-12 are detected from $schema, and every error is listed with its JSON Pointer path. Nothing leaves your browser. To check JSON syntax only, use the JSON validator.
Input
Result
Paste a schema and a document, then press Validate.
How the check works
The page loads Ajv 8.12.0 and ajv-formats 3.0.1 from jsDelivr (pinned versions) the first time you press Validate, then runs everything locally. The dialect comes from the schema's $schema: http://json-schema.org/draft-07/schema#, https://json-schema.org/draft/2019-09/schema or https://json-schema.org/draft/2020-12/schema. Other values, such as draft-04 or draft-06, are rejected. The schema is first checked against its own meta-schema, then the document is checked with all-errors mode on, so you see every problem at once instead of only the first.
Reading the result
Each row gives the instance path, a JSON Pointer (RFC 6901) into your document where the problem sits (an empty path is the whole document; ~0 stands for ~ and ~1 for / inside a key); the failed keyword; what the schema expected; and what was received. The small line under the keyword is the path inside the schema.
Limits you should know
- No network. A
$refto another file or URL is not fetched. It fails with an unresolved-reference error. Local references such as#/$defs/namework, as do$id-based references inside the same schema. - Formats. Only the
formatnames that ajv-formats defines are checked, and the result lists anyformatin your schema that was not checked. Note thatpasswordandbinaryaccept any string. The specification treatsformatas an annotation by default in 2019-09 and 2020-12; Ajv asserts it, so this tool does too. - Unknown keywords are ignored rather than rejected, so a misspelled keyword does not raise an error. Check the spelling yourself if a rule does not seem to apply.
- Numbers are parsed by the browser's
JSON.parse, so integers beyond 253 lose precision before validation.
Sources: JSON Schema specification (dialects and keywords); RFC 6901, JSON Pointer; Ajv error objects.
Frequently asked questions
What is the difference between this and a JSON validator?
A JSON validator only checks that the text is well-formed JSON. A JSON Schema validator checks that well-formed JSON has the right shape: required properties, types, ranges, patterns and so on, as described by a schema.
Which JSON Schema drafts are supported?
Draft-07, 2019-09 and 2020-12, chosen from $schema. With no $schema, 2020-12 is assumed. Draft-04 and draft-06 are not supported.
Why did my $ref fail to resolve?
The tool never downloads schemas. References to a remote URL or file cannot be resolved; paste the referenced schema into $defs (or definitions in draft-07) and point at it with a local #/... reference.
Is my data uploaded anywhere?
No. Your schema and document are validated in your browser. The only network request is the one-time download of the Ajv library files.
Result depends on the Ajv implementation
A pass means Ajv 8.12.0 found no violation of the schema as loaded here, with the limits above. Other validators may differ on edge cases, and a passing result does not check anything the schema does not say.