deftools.io JSON Tools

JSON Schema Tester & Validator

Validate JSON against a schema online — paste your JSON Schema and data, see errors at the exact path with detailed diagnostics and a full compliance report.

About this tool

JSON Schema Validator checks whether a JSON document conforms to a JSON Schema (Draft 2020-12). Paste a schema on the left and JSON data on the right, then click Validate — or just start typing, and the validator runs automatically.

It supports the core validation keywords: types, required properties, enum, const, pattern (regex), string length limits, numeric ranges (minimum/maximum/multipleOf), array length and uniqueness (minItems/maxItems/uniqueItems), object property constraints (additionalProperties, minProperties/maxProperties, dependentRequired), format checkers (email, URI, UUID, IPv4, hostname, date-time, and more), and logical combinators (allOf/anyOf/oneOf/not/if-then-else).

Example: schema {"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]} rejects {} because the required name property is missing, and rejects {"name":""} because the string is shorter than minLength: 1.

Use it to validate API payloads during development, check configuration files against a schema before deployment, or experiment with schema keywords to understand how they interact.

FAQ

What JSON Schema version does this validator support?

It targets JSON Schema Draft 2020-12, the current standard. Most keywords from draft-04 through draft-07 also work because they are a subset of 2020-12.

Why does my data pass even though I expect it to fail?

JSON Schema applies constraints additively — if a keyword is missing, no constraint is enforced. For example, if you omit <code>"type"</code>, any value is accepted. Double-check that the schema explicitly declares every constraint you intend, especially <code>"required"</code>, <code>"type"</code>, and <code>"additionalProperties": false</code>.

Does it support <code>$ref</code> and <code>$defs</code>?

Not yet — references (<code>$ref</code>) and definition re-use (<code>$defs</code>) require schema resolution across the document. For self-contained schemas without refs, the validator handles the full keyword set listed above.

How does the automatic validation work?

After you finish typing (400 ms debounce), the validator re-runs if both schema and data fields are non-empty. You can also press Ctrl+Enter at any time to trigger an immediate validation.

How do I create a schema to validate against?

If you have sample JSON data but no schema yet, use the JSON Schema Generator — paste your sample data and it infers a schema with detected types and formats. Copy that schema into this validator to test it against more examples.

More json tools

Copied!