JSON Schema Validator: check JSON data against a schema

Draft

About the JSON Schema Validator

JSON Schema describes what a JSON document should look like: which properties are required, what type each value has, which numbers are allowed and which strings must match a pattern. This tool checks a JSON document against a schema and tells you exactly what is wrong.

Every error shows the JSON pointer to the value, the keyword that failed, such as required, type or enum, and a plain message. Click an error and the matching value is selected in the data box. It supports draft-07, 2019-09 and 2020-12, strict mode, format checks and a choice between the first error and all of them. It runs in your browser with the open source Ajv library.

How to validate JSON against a schema

  1. Paste your schema into the left box, or press Upload. Press Sample to see an example.
  2. Paste the JSON to check into the right box.
  3. Pick a draft, or leave it on Auto-detect to follow the $schema line.
  4. Read the list of errors, and click one to jump to it in the data.
  5. Press Copy errors to share the list.

Frequently asked questions

How do I validate JSON against a schema?

Paste your JSON Schema on the left and the JSON data on the right. The result updates as you type. Each problem is listed with its JSON pointer path, the schema keyword that failed and a plain message. Click one to select that spot in the data.

Which JSON Schema drafts are supported?

Draft-07, 2019-09 and 2020-12. Auto-detect reads the $schema line in your schema and uses 2020-12 when there is none. Older drafts such as draft-04 are not supported.

What does Strict mode do?

With Strict mode on, Ajv rejects schemas that contain unknown keywords, ambiguous types or tuple mistakes, which usually means a typo. Turn it off to allow custom keywords and looser schemas.

What does the All errors option do?

On, the validator keeps going after the first failure and lists every problem. Off, it stops at the first one, which is faster on very large data.

Does it check formats such as email and date?

Yes, when Check formats is on. It covers date, time, date-time, email, hostname, ipv4, ipv6, uri, uuid, regex and more. Turn it off if you only want the structure checked.

Can a schema reference another file or URL?

References inside the schema, such as #/$defs/address, work. Nothing is fetched from the web, so a $ref to another file or URL cannot be resolved. Paste the referenced definitions into the schema instead.

How are invalid JSON errors reported?

If the schema or the data is not valid JSON, the tool shows the line and column of the first problem with a plain message and a Go to error button that selects it.

Is my data uploaded anywhere?

No. Validation runs in your browser with the open source Ajv library, and nothing leaves your device.