Small Tools
JSON utility

JSON Schema Validator

Check whether a JSON value matches a JSON Schema (draft 2020-12, 2019-09 or 07) and see where it does not.

● This tool runs entirely in your browser. Your input is never uploaded to our servers.

Loading the validator…

How to use JSON Schema Validator

  1. Paste the JSON Schema and the JSON data. Leave Draft on Auto to follow $schema (2020-12 when absent).
  2. Select Validate. Empty input, invalid JSON and an unusable schema are each reported as their own problem.
  3. For every error, use the data location (a JSON Pointer) to find the value and the schema location to find the rule.

Example

Input / settings:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": { "type": "integer", "minimum": 1 },
    "email": { "type": "string", "pattern": "^[^@\\s]+@[^@\\s]+$" },
    "role": { "enum": ["admin", "member"] }
  },
  "additionalProperties": false
}

{
  "id": 0,
  "email": "not-an-email",
  "role": "guest",
  "extra": true
}

Output:

Invalid: 4 errors (draft 2020-12)
/id — #/properties/id/minimum — 0 is less than 1.
/email — #/properties/email/pattern — String does not match pattern.
/role — #/properties/role/enum — Instance does not match any of ["admin","member"].
/extra — #/additionalProperties — Property "extra" does not match additional properties schema.

The first block is the schema and the second is the data. Paths are shown as data location — schema location — message.

When to use

Overview

JSON Schema describes what a JSON value must look like: its types, required properties, allowed values, number ranges and so on. This tool checks a JSON value against a schema in your browser and lists every place where the value breaks a rule, so you can fix the data or the schema.

Supported input

A JSON Schema (an object, or true/false) and the JSON value to check, each up to 500,000 characters.

Output details

Valid, or a list of errors. Each error has a JSON Pointer to the failing part of your data, the path of the failing keyword in the schema, the keyword and a message. Problems with the input are reported separately from validation errors: empty input, invalid JSON, or an unusable schema.

Format and version scope

Limitations

Common mistakes

Practical tips

Privacy and security

This tool runs entirely in your browser. Your input is never uploaded to our servers. The schema and data are checked locally in your browser. They are not uploaded, saved in browser storage, or sent in any request, and external $ref targets are never fetched.

References

Frequently asked questions

Why is my external $ref reported as an error?

This tool never makes a network request, so it cannot download a schema from a URL or another file. Copy the referenced schema into $defs and use a local #/$defs/… reference, or give it an $id inside the same document.

Which JSON Schema drafts are supported?

Draft 2020-12 (the default), 2019-09 and draft-07. Auto follows the $schema keyword; choosing a draft in the menu overrides it. Other drafts such as draft-04 are rejected.

Does it check that my schema is itself valid?

Only partly. It reports invalid JSON, a schema that is not an object or boolean, an unsupported $schema, an invalid pattern and an unresolved $ref. It does not validate the schema against the meta-schema, so a misspelled keyword is simply ignored.

Related tools