JSON Schema Validator

Validate JSON against a JSON Schema (draft 4, 6/7, 2019-09, 2020-12) with clear error paths, or generate a schema from an example document.

Runs locally in your browser

4 errors

  • /versionString does not match pattern./properties/version/pattern
  • /price-5 is less than 0./properties/price/minimum
  • /tags/1Instance type "number" is invalid. Expected "string"./properties/tags/items/type
  • /mailString does not match format "email"./properties/mail/format

Error messages come from the validator and are in English.

About this tool

A JSON Schema describes what a JSON document must look like: which fields are required, which types are allowed, minimum and maximum values, patterns and formats such as email or date. APIs (e.g. in OpenAPI descriptions), config files and editors use it to catch mistakes early.

The validator checks your JSON against a draft 4, 6/7, 2019-09 or 2020-12 schema and shows every error with the path to the affected value and to the rule in the schema. If you do not have a schema yet, the tool generates one from an example document that you can refine. Everything runs in your browser; your data is not uploaded.

How it works

  1. Paste your JSON document on the left and the JSON Schema on the right.
  2. The tool detects the version from the “$schema” field. You can also choose it yourself.
  3. The result appears instantly: either “matches the schema” or a list of errors with path and rule.
  4. Without a schema, click “Generate schema from JSON” and adjust the result, e.g. with minimum values or formats.

Frequently asked questions

Which schema versions are supported?

Draft 4, draft 6/7, 2019-09 and 2020-12, including $ref to definitions in the same schema. External schemas referenced by URL are not fetched.

Are formats like email or date checked?

Yes, the “format” keyword is validated, e.g. for email, date, date-time, uri, uuid, ipv4 and ipv6.

How good is the generated schema?

It describes the types, properties and array items of the example and makes every present field required. For several objects in an array, only fields that appear in all of them are required. The tool cannot guess limits, patterns and formats – add them yourself.

Why are the error messages in English?

They come straight from the validator. The path and rule next to them show unambiguously which value violates which keyword. Format JSON and check it for syntax errors with the JSON Formatter & Validator; compare two documents with JSON Compare.