JSON Schema Validator

Validate a JSON document against a JSON Schema.

Open tool

Overview

The JSON Schema validator checks a JSON document against a JSON Schema and reports every constraint violation with its location and the rule that failed. Paste both the schema and an instance, and see whether the data conforms.

It's the right tool when debugging an API contract, validating user-submitted JSON before persistence, or testing a schema you've just written. Backend developers and API designers use a json schema validator to confirm both sides of a contract before shipping code that depends on the shape.

How it works

The validator implements drafts 04, 06, 07, and 2020-12, picking the right rule set from the schema's $schema declaration. Constraints checked include type, properties, required, additionalProperties, items, minimum/maximum, minLength/maxLength, pattern, enum, const, oneOf/anyOf/allOf, and $ref to internal $defs definitions.

Failures are reported with two paths: an instancePath JSON Pointer to the failing data, and a schemaPath JSON Pointer to the violated keyword. That's the same shape Ajv and other major validators use, so error messages are portable to downstream tooling.

Examples

Schema:
{ "type": "object",
  "properties": { "age": { "type": "integer", "minimum": 0 } },
  "required": ["age"] }

Instance:  { "age": -5 }
Result:    FAIL — /age violates minimum (got -5, expected ≥ 0)
Instance:  { "age": "thirty" }
Result:    FAIL — /age violates type (expected integer, got string)
Instance:  { "age": 30 }
Result:    PASS

FAQ

Does it follow remote $ref URLs?

No — remote schema resolution is disabled to avoid outbound network calls. Internal $ref references using #/$defs/... or #/definitions/... are followed fully.

What about format validation?

format keywords are validated for the common ones (date-time, email, uri, uuid, ipv4, ipv6). Custom or vocabulary-defined formats are reported as "format not implemented" rather than silently passing.

Are draft 2020-12 features supported?

Yes — tuple prefixItems, unevaluatedProperties, dependentSchemas, and the keyword changes from draft 2019-09 onwards are all implemented.

Try JSON Schema Validator

An unhandled error has occurred. Reload ×