Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

JSON Schema Validator

JSON data

Paste the JSON to check, or

JSON Schema

Paste its JSON Schema, or

Ready
Runs in your browser. Nothing you paste is uploaded unless you share it.

Validate JSON against a JSON Schema, draft 3 to 2020-12

Paste your JSON and its schema to see whether it fits, and if not, every problem at its place in the JSON.

How to use it

  1. Paste the JSON on the left and the JSON Schema on the right, or open a file on each side.
  2. Leave Draft on Auto to use the schema’s "$schema", or pick a draft.
  3. Read the problems; click one to select its line in the JSON. Copy report copies them all.

Examples

A value outside an enum, and a key the schema doesn’t allow

Input
JSON: {"plan": "pro", "region": "eu"}
Schema: {"properties": {"plan": {"enum": ["free", "team"]}}, "additionalProperties": false}
Result
$.plan  line 1, column 10  Should be one of ["free","team"]
$.region  line 1, column 27  "region" isn’t one of the properties allowed here

Each problem names the value by its path and its place, so you can find it in a long file.

A required property missing in a nested object

Input
JSON: {"user": {"name": "Ada"}}
Schema: {"properties": {"user": {"required": ["email"]}}}
Result
$.user  line 1, column 10  Missing the required property "email"

What it checks

The keywords of drafts 4, 6, 7, 2019-09 and 2020-12: types, required, enum and const, numbers (minimum, multipleOf), strings (length, pattern, format), arrays (items, prefixItems, contains, uniqueItems), objects (properties, patternProperties, additionalProperties, propertyNames, dependencies), combinations (allOf, anyOf, oneOf, not, if/then/else), "$ref" inside the schema, and unevaluated properties and items.

Auto reads the draft from the schema’s "$schema"; with none it checks as draft 2020-12 and says so. A failing anyOf or oneOf is shown as one problem, not as every branch that failed.

What it doesn’t do

The checks run in this tab, so a few things work differently from a server validator:

  • It doesn’t download schemas: a "$ref" to a URL outside the schema is named as a problem. Put the schema it points to under "$defs" and point to "#/$defs/…".
  • "$dynamicRef" is read like a plain "$ref", and the page says so when a schema uses it.
  • Numbers with more digits than a JavaScript number keeps are checked rounded, and the page says how many.
  • Draft 3 is checked with its own rules: "required": true inside a property, "extends", "disallow", "divisibleBy", "any" and schemas in "type", and "$ref" replacing the keywords beside it. Drafts 2 and older are refused, with a message saying so.
  • Up to 1,000 problems are listed; the count above the list is exact.

Questions

Why does "format": "email" pass here but fail elsewhere, or the other way round?
Since draft 2019-09, "format" is only a label unless a validator is told to check it, so validators differ. This page checks it, and when a format fails under 2019-09 or 2020-12 it says that other validators may accept the value.
Can I validate against a schema that uses $ref to another file?
Only to parts of the same schema ("#/$defs/address"). Copy the other schema under "$defs" and point to it there; the page fetches nothing.
Why does it say the schema box holds data?
The right side has no schema keyword (type, properties, required…), so it looks like JSON data rather than a schema. Check that the JSON and the schema are in the right boxes.
Is my data uploaded?
No. Everything runs in your browser, so your JSON and schemas stay on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. API payloads and configs often hold keys, and the page warns you if it spots one.

Related tools