Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

JSON Schema Validator (Draft 2020-12 and Draft-07)

Check JSON against a schema and list every error clearly.

Use via API

Validate a JSON document against a JSON Schema (draft 2020-12 or draft-07). Returns valid, every error with its JSON Pointer path and schema keyword, and warnings about unsupported keywords. Send JSON, get JSON back.

POST https://pithlab.com/api/v1/tools/json-schema-validator

curl https://pithlab.com/api/v1/tools/json-schema-validator \
  -H "Authorization: Bearer $PITHLAB_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schema":"{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\",\"minimum\":0}}}","data":"{\"name\":\"Ada\",\"age\":-1}"}'

Fields and responseOpenAPI documentGet an API key

About the JSON Schema Validator

Validate JSON data against a JSON Schema in your browser. See every error with its path and a plain English message. Supports draft 2020-12, draft-07 and common formats.

How to use the JSON Schema Validator

  1. Paste your JSON Schema into the schema box.
  2. Paste the JSON data you want to check into the data box.
  3. Leave the draft on Auto to read it from $schema, or pick 2020-12 or draft-07.
  4. Read the result: each error shows the path to the failing value, a plain English message and the schema keyword that failed.
  5. Copy the error list to share it, or fix the data and watch the result update.

Examples

Several errors at once

Input

Schema:
{"type":"object","required":["name","age"],"properties":{"name":{"type":"string"},"age":{"type":"integer","minimum":0},"email":{"type":"string","format":"email"}},"additionalProperties":false}

Data:
{"name":"Ada","age":-1,"email":"ada@","role":"admin"}

Output

/age: must be >= 0
/email: must be a valid email
(root): has a property "role" that is not allowed
A $ref to $defs used for array items

Input

Schema:
{"$defs":{"tag":{"type":"string","minLength":1}},"type":"array","items":{"$ref":"#/$defs/tag"},"uniqueItems":true}

Data:
["json","schema",""]

Output

/2: must be at least 1 character long
Valid data

Input

Schema:
{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"created":{"type":"string","format":"date-time"}},"required":["id"]}

Data:
{"id":"3f1c9a2e-8b7d-4c6a-9e1f-2a3b4c5d6e7f","created":"2026-10-19T08:30:00Z"}

Output

Valid

Frequently asked questions

Which keywords are supported?

type, enum, const, properties, required, additionalProperties, patternProperties, propertyNames, min/maxProperties, dependentRequired, dependentSchemas, dependencies, items, prefixItems, additionalItems, contains, min/maxContains, min/maxItems, uniqueItems, min/maxLength, pattern, format, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, allOf, anyOf, oneOf, not, if/then/else and $ref.

What is not supported?

$ref only works inside the same schema (such as #/$defs/name, #/definitions/name or #), not to other files or URLs. unevaluatedProperties, unevaluatedItems and $dynamicRef are ignored, and the tool warns when your schema uses them. For full spec compliance, use Ajv or another complete validator in your build.

Which formats are checked?

email, uri, date, time, date-time, uuid, ipv4, ipv6 and hostname. Dates are checked for real days, including leap years. Other formats are treated as annotations and not checked, as the specification allows, and the tool tells you which ones it skipped.

What changes between draft-07 and 2020-12?

The main difference is arrays: in draft-07 an items array means a tuple and additionalItems covers the rest, while 2020-12 uses prefixItems for tuples and items for the rest. In draft-07, keywords next to $ref are also ignored. Auto mode picks draft-07 when $schema names draft-04, 06 or 07.

Why not use Ajv here?

Ajv generates JavaScript code at runtime, which this site's strict security policy blocks. So this tool uses its own small validator that runs entirely in your browser, and your schema and data never leave your device.

Guides that use this tool

  • JSON vs YAML: when to use which

    JSON and YAML describe the same data, but they fail in different ways. A practical guide to choosing between them, with the YAML gotchas that bite in production.