JSON Schema Validator
Validate JSON against a JSON Schema online. Every error shows the failing path, line and rule; drafts 2020-12, 2019-09, 7 and 4 are supported.
Something not working, or missing a feature? Send feedback
About the JSON Schema Validator
The JSON Schema Validator checks a JSON document against a JSON Schema and lists every rule it breaks: the path of the failing value, its line, the message and the keyword that failed. Use it to test API payloads, config files and fixtures against a contract, or to debug a schema before it goes into CI. Drafts 2020-12, 2019-09, 7 and 4 are supported, and nothing leaves your browser.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the JSON Schema Validator
- Paste your schema on the left and the JSON to check on the right, or open each from a file.
- The draft is read from the schema's $schema keyword; choose one in the Draft menu to override it.
- Read the result below the editors: either a valid confirmation, or every error with its JSON path, line and failing keyword.
- Fix the data (or the schema) and the result updates as you type.
Common mistakes
- Forgetting additionalProperties. By default a schema allows keys it does not mention, so a typo such as "emial" passes silently. Add additionalProperties: false (or unevaluatedProperties: false when you combine schemas with allOf) to catch unknown keys.
- required inside properties. required is an array on the object schema, listing property names. Writing "required": true inside a property is a draft 3 habit and is ignored by later drafts.
- Mixing draft keywords. definitions with $schema 2020-12, or a number for exclusiveMinimum in draft 4, either does nothing or means something else. Match the keywords to the draft in $schema.
Works well with the JSON Schema Validator
- JSON Schema Generator: draft a schema from an example document.
- JSON Validator: fix JSON syntax errors first.
- JSON Viewer: explore the document a path points to.
Frequently asked questions
Which JSON Schema drafts are supported?
Draft 2020-12 (the default), 2019-09, draft 7 (which also covers draft 6) and draft 4. The draft comes from the $schema keyword when it is present. The differences matter: in draft 4, exclusiveMaximum is a true/false modifier, while later drafts give it a number; $defs replaced definitions in 2019-09, and prefixItems replaced the array form of items in 2020-12.
Are formats such as email and date-time checked?
Yes. Values with format date-time, date, time, duration, email, hostname, ipv4, ipv6, uri, uri-reference, uuid, json-pointer and regex are checked. The specification lets validators treat format as a note only, so check what yours does: Ajv, for example, needs the ajv-formats plugin to check formats, and some libraries skip them entirely, so a document that fails here can pass there.
Can the schema use $ref?
Yes, within the same schema: #/$defs/name, #/definitions/name, $id and $anchor references all resolve. References to other files or URLs are not downloaded; paste the referenced definitions into $defs instead.
Is my data uploaded?
No. Validation runs in your browser with @cfworker/json-schema, a validator that does not use eval, so the schema and the document stay on your device.
Related tools
JSON Validator
Validate JSON online and find syntax errors such as trailing commas or single quotes by exact line and column. Valid documents get a structure summary.
XML Validator
Validate XML online and check that it is well-formed. Syntax errors are reported with their exact line and column, so broken tags are easy to find.
YAML Validator
Validate YAML syntax online, find errors by line, and see the parsed result as JSON. Check Kubernetes, Docker Compose and CI files before you deploy.
Regex Tester
Test JavaScript regular expressions online with live match highlighting, capture groups and flags. Debug a pattern against your own text, right in your browser.
JSON Formatter
Format and beautify JSON with configurable indentation and optional key sorting. Errors are reported with exact line and column.
HTML Formatter
Format and beautify messy or minified HTML into clean, indented markup with Prettier, including embedded CSS and JavaScript. Runs locally in your browser.