JSON Schema Validator

Check JSON data against a JSON Schema (draft 2020-12 and draft-07 keywords) and see every failing field with its data path, the problem and the schema keyword.

Schema
Data

Common JSON Schema draft 2020-12 and draft-07 keywords supported. Remote $ref not supported.

About JSON Schema Validator

The JSON Schema Validator checks your JSON data against a JSON Schema and lists every failing field with its path, the problem and the schema keyword. Supports draft 2020-12 and draft-07 keywords.

Every error at once

See all problems, not just the first, with data paths such as /age, so you can fix everything in one go.

Format checks

Email, date and other formats are checked; untick Check format keywords to skip them.

References

$ref pointing inside the same schema, such as #/$defs/pos, works.

Good for

Designing an API, validating config files and testing data before import.

Private

Everything runs in your browser. Nothing you paste is uploaded.

What is JSON Schema?

JSON Schema is a standard way to describe what valid JSON looks like: required fields, types, allowed values and formats. APIs use it to check requests and to document data.

How to use JSON Schema Validator

  1. Paste your JSON Schema in the first box and your JSON data in the second, or press Load example.
  2. Tick or untick the format-keywords option.
  3. Press Validate.
  4. Read the table of errors and fix the data or the schema.

Related guide: How to Format and Validate JSON (With Common Errors Explained)

Help & FAQ

Which JSON Schema versions are supported?

Common keywords from draft 2020-12 and draft-07. It is not a full implementation of every keyword, so check unusual keywords against a reference validator.

What does the format option do?

It enforces format keywords such as email, date, uri, uuid and ipv4. In our test, turning it off removed the email format error and left the other six.

Can we use $ref?

Yes for references inside the same schema, such as #/$defs/name. Remote references to other files or URLs are not supported, and nothing is downloaded.

What do the three columns mean?

Data path is where the problem is in your data, Problem explains it in words and Schema keyword shows which rule in the schema failed.

What does (root) mean?

It refers to the whole document, for example a missing required property or an unexpected extra property at the top level.

Why do we get two errors for one value?

A value can break several rules. In our test, an age of 17.5 failed the integer type and the minimum of 18.

What happens if our JSON has a syntax error?

The tool reports Invalid data and the position of the error, for example a trailing comma, instead of listing schema errors.

How do we make extra properties an error?

Add additionalProperties set to false in the schema. The validator then reports unexpected property names.

Does exclusiveMinimum work?

Yes. In draft 2020-12 it is a number, and a value of 0 against exclusiveMinimum 0 failed with the message that it must be > 0.

Is our data uploaded?

No. Validation runs in your browser. In our network check, only routine analytics requests were sent.

Can it generate a schema from our data?

No. It validates data against a schema you provide.

How is this different from the JSON Validator?

The JSON Validator checks that text is valid JSON. This tool also checks that valid JSON has the right structure and values for a schema.

More in Developer Tools

See all 39 in Developer Tools