JSON Schema Validator

Paste the data on the left and the schema on the right.

Use this tool

Result

The result appears in this panel after you run the tool.

About this tool

Ajv compiles the schema in this browser and reports each error path.

Only draft 2020-12 is claimed. Remote $ref URLs are not fetched.

How to use it

  1. Open this page and provide the input it asks for.
  2. Set the options that are visible, then use Validate.
  3. Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.

Limitations

Ajv checks one document against one schema

Both boxes have to be JSON before any rule runs

Ajv compiles one schema and checks one document. The schema text is parsed as JSON and compiled with all errors collected and strict mode off. The data text is parsed as JSON and passed to that compiled check. When the check passes, the page says the data is valid for this schema. When it fails, each problem is listed with the instance path, or a slash when the path is empty, and the message Ajv attached. The page does not stop at the first problem.

Strict mode is off so schemas that would trip Ajv’s stricter warnings can still compile. That does not mean every schema feature is fetched from the network. A reference that points at a URL is not downloaded. The schema you pasted has to contain what the compiler needs, or the compile fails. Both parses are ordinary JSON parses, so comments and trailing commas fail before any schema rule is considered.

What a pass does and does not mean

A pass means this data matches this schema under those compiler settings. It does not mean the data is the only document that would match. It does not mean a different draft would agree if the schema uses a keyword this compiler treats loosely because strict mode is off. Formats, required keys, types, and additional-property rules are whatever the schema text says. The formatter never applies those rules. A pretty listing can still be invalid for a schema you have not pasted here.

Reading the path column

The path is the location inside the data document, not a line number in the textarea. A missing required key and a value of the wrong type land on different paths. Fix the data or the schema and run again. The generator that builds a schema from one sample is not this check. A generated schema can be pasted here later, and you should expect it to accept the sample it was built from while still being incomplete for other samples.

Privacy

Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.