JSON Schema Validator

Dialect: from $schema
JSON Schema1 line
JSON Data1 line

Paste a schema and the data to check. Results appear here as you type.

READY
SCHEMA 0 CHARSDATA 0 CHARS

About the JSON Schema Validator

The JSON Schema Validator checks a JSON document against a JSON Schema and lists every place where it does not match. It uses @cfworker/json-schema, which interprets the schema instead of compiling it to code, and supports draft-04, draft-06, draft-07, 2019-09, and 2020-12; the dialect is read from the `$schema` keyword, and a schema without `$schema` is checked as draft-07. Validation runs in your browser and nothing is sent to our servers or analytics. Your schema and data are not saved in the page address; they go into a link only when you click Share, so avoid sharing documents that hold secrets or real customer records.

Updated: November 13, 2026

How to use the validator

  • Paste your schema in the left panel and the JSON to check in the right panel, or drop a `.json` file onto either one. Validation runs as you type.
  • The result panel shows one of four things: a green Valid message, a table of validation errors, an invalid-JSON message for the schema or the data (with line and column when your browser reports them), or an invalid-schema message when the schema itself has a problem.
  • The error table lists the instance path as a JSON Pointer (`(root)` is the whole document, whose pointer is the empty string, `/address/zip` is the `zip` property of `address`, `/tags/0` is the first array item), the message, and the keyword that failed, such as `type`, `required`, `enum`, or `pattern`. A Line column points to the failing value in your data when it can be found. When a value fails inside a nested subschema or a `$ref`, only the innermost failing keyword is listed; a failed `anyOf` or `oneOf` is listed together with the reason each branch failed.
  • Click Sample to load a schema and data pair with a few deliberate mistakes, and Copy Report to copy the dialect and every error as plain text.

Supported drafts and formats

  • The `$schema` URI picks the validator: `http://json-schema.org/draft-04/schema#` for draft-04, `http://json-schema.org/draft-06/schema#` or `http://json-schema.org/draft-07/schema#` for draft-06 and draft-07, `https://json-schema.org/draft/2019-09/schema` for 2019-09, and `https://json-schema.org/draft/2020-12/schema` for 2020-12. The trailing `#` is optional. Draft-06 and draft-07 are both checked with draft-07 rules, and so is a schema with no `$schema`. Any other `$schema` URI is reported as an invalid schema, and a near miss such as `https` for draft-07 is called out with the URI that works.
  • These formats are checked in every draft, draft-04 included: `date`, `time`, `date-time`, `duration`, `uri`, `uri-reference`, `uri-template`, `url`, `email`, `hostname`, `ipv4`, `ipv6`, `regex`, `uuid`, `json-pointer`, `json-pointer-uri-fragment`, and `relative-json-pointer`. A `time` must include a time zone, such as `10:30:00Z` or `10:30:00+02:00`. A format applies to string values only; numbers, booleans, and other types pass it. Any other format, including OpenAPI names such as `int32`, `int64`, `float`, `double`, `byte`, `binary`, and `password`, is reported as an unknown format.
  • Before validating, the schema itself is checked. An unknown keyword or an unknown format is reported as an invalid schema instead of being ignored silently, which catches typos such as `requried` or `minLenght`. Keywords that start with `x-`, such as OpenAPI's `x-nullable`, are vendor extensions: they are allowed and ignored. So are a `type` that is not one of the seven JSON types, a `pattern` or `patternProperties` key that is not a valid regular expression, a negative or fractional length or count such as `minLength`, a `multipleOf` of 0 or less, a `$ref` that does not resolve inside the schema, and `$dynamicRef` or `$dynamicAnchor`, which this validator does not support. In draft-04, `exclusiveMinimum` and `exclusiveMaximum` must be booleans and `true` or `false` is allowed as a subschema only for `additionalProperties` and `additionalItems`; later drafts take numbers and allow boolean subschemas anywhere.
  • This check is not a full comparison with the official meta-schema, so a rarer mistake can pass it. Keywords from any supported draft are accepted in every draft: a 2020-12 keyword such as `prefixItems` in a draft-07 schema is applied, not reported.

Worked example

  • Schema: an object that requires `id` (integer), `email` (string with `format: email`), and `role` (one of `admin`, `editor`, `viewer`). Data: `{"id": "42", "email": "not-an-email", "role": "owner"}`.
  • Result: `/id` fails `type` ("Instance type "string" is invalid. Expected "integer"."), `/email` fails `format` ("String does not match format "email"."), and `/role` fails `enum` ("Instance does not match any of ["admin","editor","viewer"]."). All errors are listed at once because the validator does not stop at the first one.
  • A missing required property is reported on its parent object. If `email` were absent, the error would be at `(root)` with the keyword `required` and the message "Instance does not have required property "email".".

Limits and tips

  • References are resolved inside the schema only. `$ref` values such as `#/definitions/item` or `#/$defs/item` work, but the validator never downloads a schema from a URL, so a `$ref` to another file is reported as an invalid schema. Merge the referenced schema into `$defs` (or `definitions` for older drafts) first.
  • A `$schema` or `$id` is not fetched either. The `$schema` value is only used to choose the draft.
  • Validation checks structure, not meaning. `format` checks cover syntax only, so an `email` format accepts any well-formed address, whether or not it exists.
  • Numbers are read with the browser's `JSON.parse`, so integers above 2^53 lose precision before the schema sees them.
  • Validation runs in a background worker and is stopped after 2 seconds. A `pattern` or `patternProperties` regular expression with nested repetition, such as `^(a+)+$`, can backtrack for a very long time on some strings; instead of freezing the page, the result says validation timed out.

Frequently Asked Questions

Which JSON Schema versions does this validator support?
Draft-04, draft-06, draft-07, 2019-09, and 2020-12. The `$schema` keyword chooses the version. Draft-06, draft-07, and a schema with no `$schema` are all checked with the draft-07 validator.
What happens when my schema has no $schema keyword?
It is validated as draft-07. The dialect shown above the editors says so. Add a `$schema` URI to validate against another draft.
Why does my schema show as invalid when it looks correct?
The schema is checked before the data. It is reported as invalid for an unknown keyword, an unknown format, a wrong `type` value, an invalid regular expression, a `$schema` URI it does not recognize, or a `$ref` it cannot resolve inside the schema. The message names the problem and where it is in the schema, such as `Invalid schema at /properties/age/type`.
Can the schema use $ref to a URL?
No. Remote references are not downloaded, because the validator makes no network requests. Local references to `#/$defs/...` or `#/definitions/...` work. To use a remote schema, paste its contents under `$defs` and point your `$ref` at it.
What does the instance path in the error table mean?
It is a JSON Pointer (RFC 6901) to the value in your data that failed. The root is the empty pointer, shown as `(root)`; `/` on its own is a property whose name is the empty string. `/items/2/name` is the `name` property of the third item in `items`. Property names containing `/` or `~` are written as `~1` and `~0`. For a missing required property the path is the object that lacks it.
Is my data sent anywhere?
No. The schema and data are validated by code running in your browser tab, and neither is sent to our servers or analytics. They are not put in the page address as you type. Clicking Share builds a link that contains both, compressed but not encrypted, so remove secrets and personal data before sharing it.