datapry

JSON Schema Validator

Validate JSON against a JSON Schema and see every violation at its exact location. Runs in your browser, so nothing is uploaded.

JSON data

JSON Schema

Result

Paste both documents to check them.

Waiting for input

About this tool

Check that a payload matches its contract before it reaches production. Paste the data and the schema, and every violation is listed with its path and underlined at the exact line. The draft is read from $schema, and the schema is interpreted locally without downloading anything.

How to use it

  1. Paste the JSON data on top and the JSON Schema below.
  2. Read the result as you type.
  3. Select an error to jump to that place in the data.

Example

Input
{
  "id": "7",
  "plan": "enterprise"
}
Output
Line 2, column 3: $.id: Instance type "string" is invalid. Expected "integer".
Line 3, column 3: $.plan: Instance does not match any of ["free","pro"].

Questions

Which JSON Schema drafts are supported?
Drafts 4, 7, 2019-09 and 2020-12. The draft comes from the schema's $schema keyword, and 2020-12 is used when there isn't one.
Can my schema use $ref?
Yes, for references inside the same schema, such as #/$defs/address. Remote references are never downloaded, so paste those definitions into the schema instead.
Why not use Ajv?
Ajv compiles schemas into JavaScript at runtime, which this site's security policy blocks. The validator used here interprets schemas instead, so no code is generated.