JSON Schema validator (draft-07) — every violation with its path

Paste a draft-07 JSON Schema and the JSON data to check, and the tool lists every rule the data breaks, each with the path to the failing value, the schema keyword and a short explanation.

Live demo · real result from this tool

Valid — the data conforms to the schema.

Processed on your device — nothing is uploaded.

How to use the JSON Schema validator

  1. Paste your schema into JSON Schema (draft-07). The sample requires an id and email and allows only three role names.
  2. Paste the document to check into JSON data.
  3. Read the result. Valid — the data conforms to the schema. means every rule passed.
  4. Otherwise, the Violations table has one row per problem: Path, Keyword and Problem.

If either box holds invalid JSON, the tool points at the line and column first.

What it does and when to use it

A schema describes what a valid document looks like: required fields, types, ranges, allowed values. Use this tool to check a sample API request before you send it, to see why a config file fails validation in CI, or to test a schema you are writing against good and bad examples. Because every violation is listed, not just the first, you can fix them all in one pass.

To get a starting schema from an example document, use the JSON Schema generator. To check that the data is valid JSON at all, use the JSON validator. For typed code from the same sample, see JSON to TypeScript.

How it works

The validator walks the data and the schema together, following the draft-07 validation vocabulary. It checks type, enum, const, number limits (minimum, exclusiveMaximum, multipleOf and the rest), string length (counted in characters, so an emoji is one), pattern, format, array rules (items, additionalItems, contains, uniqueItems, length limits), object rules (required, properties, patternProperties, additionalProperties, propertyNames, dependencies, size limits), and the combiners allOf, anyOf, oneOf, not and if/then/else. As draft-07 says, other keywords next to a $ref are ignored. Nothing leaves your browser.

Worked examples

The default schema with this data:

{"id": 0, "email": "asha@example", "roles": ["admin", "admin", "owner"], "name": "Asha"}
Not valid — 5 problems found.
id       | minimum              | Must be ≥ 1.
email    | format               | Must be a valid email.
roles    | uniqueItems          | Items 0 and 1 are identical; items must be unique.
roles[2] | enum                 | Must be one of "admin", "editor", "viewer".
name     | additionalProperties | Property "name" is not allowed.

A conditional rule: if plan is "pro", then seats must be at least 5. The data {"plan": "pro", "seats": 2} gives seats | minimum | Must be ≥ 5.

The date "2026-02-30" against {"type": "string", "format": "date"} fails with Must be a valid date., because February has no 30th.

Limits and tips

  • For anyOf, oneOf and not, you get one summary row, not the reasons inside each branch. Test the branches one at a time to see which rule fails.
  • Very deep or circular $ref chains stop after 200 levels with a message.

Frequently asked questions

Which JSON Schema version does it support?
Draft-07. The $schema line is not read, so a schema written for 2019-09 or 2020-12 is still checked with draft-07 rules. Newer keywords such as prefixItems, unevaluatedProperties, dependentRequired and $dynamicRef are ignored rather than enforced, which can make invalid data look valid.
Can it load a $ref from a URL?
No. Only references inside the same schema work, such as
Is "format" checked?
Yes, for email, idn-email, date, time, date-time, uri, uri-reference, uuid, ipv4, ipv6, hostname, regex and json-pointer. Draft-07 lets validators treat format as a note only, so other validators may pass values this tool rejects. Formats not on the list are ignored. The email check is a simple shape test (text, @, domain with a dot).
Which regex rules does "pattern" use?
JavaScript regular expressions with the u (Unicode) flag. The pattern is searched, not fully matched, so add ^ and $ to match the whole string. Draft-07 also expects ECMA-262 regex, so patterns written for it behave the same here.
How do I generate a schema from sample data?
Use the JSON Schema generator, then tighten the result by hand (required lists, enums, minimums) and test it here against good and bad samples.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close