Tooleux

Validate JSON against a JSON Schema. Every error is listed with its path. Runs entirely in your browser.

Runs in your browser. Nothing leaves your device.
Validate a JSON document against a JSON Schema. Lists every error with its path. Draft-07. Runs entirely in your browser. Read more Show less

What is JSON Schema?

JSON Schema is a vocabulary for describing the shape of JSON data. A schema is itself a JSON document that says which fields must exist, what types they hold, which values are allowed, and how the parts relate. Because the schema is plain JSON, it can live in version control, travel with an API, and be consumed by any conforming validator.

It is the schema language behind OpenAPI, JSON:API, and many configuration systems. It is used to validate API request and response bodies, config files, package manifests, and form submissions - anywhere a formal contract on JSON shape is useful.

How to use

Paste your JSON document in the left box and your JSON Schema in the right box. The result appears below: either a confirmation that the document is valid, or a list of every error with the path where it occurred.

Three things can go wrong, and the tool reports each separately:

  • Invalid JSON - the document itself is not parseable. The error shows the position where parsing failed.
  • Invalid schema - the schema is not a valid JSON Schema (for example, a type value that is not a recognized type name, or a malformed keyword).
  • Validation failure - both parse, but the document does not match the schema. Every violation is listed with its JSON Pointer path.

Common keywords

Most real schemas use a small subset of the vocabulary:

  • type - "object", "array", "string", "number", "integer", "boolean", or "null".
  • properties - names and subschemas of object fields.
  • required - array of field names that must be present.
  • items - subschema that every array element must satisfy.
  • enum - the exact set of allowed values.
  • minimum, maximum, minLength, maxLength, pattern - numeric and string constraints.
  • additionalProperties - set to false to disallow fields not listed in properties.

Schema drafts

JSON Schema has several versions, called drafts. This tool implements draft-07, the most widely supported. Draft 2019-09 and 2020-12 add features such as unevaluatedProperties, prefixItems, and dynamic references; those are not supported here.

If a schema declares a different "$schema" value, the tool still parses it as draft-07. For most schemas the difference does not matter.

FAQ

Why does my valid JSON fail validation?

Parsing and validation are different steps. Parsing checks that the text is well-formed JSON. Validation checks that the parsed data matches the schema. A document can parse cleanly and still violate the schema - a missing required field, a string where a number was expected, or a value outside an enum.

Does this tool check string formats like email or URI?

No. Format validation is optional in draft-07 and not enabled here. A field declared {"type": "string", "format": "email"} is checked only for being a string. Use a full validator with format support if you need this.

Is my data sent anywhere?

No. Both the document and the schema stay in your browser. Validation runs in the same tab. You can confirm this in your browser's Network tab.

Which draft should I write new schemas in?

Draft-07 for maximum compatibility across tools. Draft 2020-12 if you need the newer keywords and know your consumers support it. This tool validates draft-07.

Can I validate YAML?

Convert the YAML to JSON first with the YAML to JSON tool, then paste the result here. JSON Schema is defined over JSON data, not the YAML text.

Command line equivalent
# Python (jsonschema)
pip install jsonschema
python3 -m jsonschema -i document.json schema.json

# Node (ajv-cli)
npm i -g ajv-cli
ajv validate -s schema.json -d document.json

# Go (santhosh-tekuri/jsonschema)
go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest
jv schema.json document.json
Loads a test value into the form
JSON document
JSON Schema
Validation result