Skip to content
Devtoolry

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

  1. Paste your schema on the left and the JSON to check on the right, or open each from a file.
  2. The draft is read from the schema's $schema keyword; choose one in the Draft menu to override it.
  3. Read the result below the editors: either a valid confirmation, or every error with its JSON path, line and failing keyword.
  4. 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

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.