DevToolPal
EN

JSON Schema Validator

Validate JSON data against a JSON Schema (draft 2020-12, 2019-09, 07 or 04) and see every error with its path.

Runs locally, never uploaded

Options

JSON data

JSON Schema

Validation result

Result appears here

What it does

JSON Schema is a vocabulary for describing the shape of JSON data: which properties an object must have, what type each value is, allowed ranges and patterns, array lengths and much more. APIs use it in OpenAPI specifications, editors use it for autocomplete in configuration files, and back ends use it to reject bad requests.

This validator checks a JSON document against a schema and lists every problem it finds. Each error shows where it is in the data (a JSON Pointer such as /tags/1), a readable message, and the schema keyword that failed, so you can fix the data or the schema quickly. It supports draft 2020-12, 2019-09, draft-07 and draft-04, including $ref, $defs, allOf/anyOf/oneOf, if/then/else, unevaluatedProperties and format checks.

How to use

  1. Paste the data into JSON data and the schema into JSON Schema, or upload a file to each side. Sample loads a user record with a few deliberate mistakes.
  2. The result updates as you type: a green badge when the data is valid, otherwise the number of errors and a list of them.
  3. Leave Draft on Auto to follow $schema, or force a version. Turn off Report all errors to stop at the first failure.
  4. Copy errors copies the list as plain text, for a bug report or a code review.

If either side is not valid JSON, the message says whether the data or the schema is broken and gives the line and column.

Example

With this schema:

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

the document {"age": -1} produces two errors: at (root), the required property id is missing; at /age, the value is below the minimum of 0.

Tips

Add "additionalProperties": false to catch misspelled property names, which otherwise pass silently. Use enum or const for fixed values, and pattern for strings such as product codes. When a schema grows, move repeated parts into $defs and reference them with $ref.

FAQ

› Which JSON Schema versions are supported?

Draft 2020-12, 2019-09, draft-07 (which also covers draft-06) and draft-04. With Draft set to Auto, the version is read from the schema's $schema keyword; schemas without $schema are treated as 2020-12.

› What do the error paths mean?

The first path is a JSON Pointer to the value in your data that failed, such as /items/2/price; (root) means the whole document. The grey line shows the keyword that failed and its location in the schema, such as minimum at #/properties/age/minimum.

› Are formats like email and date-time checked?

Yes. Common formats are validated: date, time, date-time, duration, email, hostname, ipv4, ipv6, uri, uri-reference, uuid, regex, json-pointer and others. Unknown formats are ignored, as the specification allows.

› Can the schema reference other files?

References inside the same schema work, for example $ref to #/$defs/address. External URLs are not downloaded, because nothing leaves your browser; paste referenced definitions into $defs instead.