JSON Schema Validator Online

Paste a JSON Schema and a JSON document to check the data against the schema's rules: required fields, types, enums, number ranges, string patterns and formats such as email and date-time. Every error is listed with the path to the failing value, such as /items/1/quantity, the keyword that failed and a plain-English message.

It supports JSON Schema draft 2020-12, 2019-09 and draft-07, including $ref, $defs and unevaluatedProperties, and runs entirely in your browser, so neither the schema nor the data is uploaded. It also flags mistakes in the schema itself, such as "type": "int" or a regex that will not compile.

SchemaDraft 2020-12 from $schema
JSON dataThe document to check
ResultsClick an error to find it in the data, or its schema path to find the keyword
  • enum
  • format
  • minimum
3 errorsDraft 2020-12 (from $schema)43 keywords checkedFormats checkedProcessed locally

How to use it

  1. Paste the JSON Schema on the left and the JSON data on the right, or drop a .json file on either.
  2. Pick a draft if the schema has no $schema and choose whether to check formats; results update as you type.
  3. Click an error to find the value in the data, then press Validate (⌘↵) or copy the report.

Related tools

JSON ValidatorFormatJSON FormatterFormatJSON to TypeScriptConvertJSON Path EvaluatorFormat

Next: fix syntax errors in the JSON Validator, tidy the document in the JSON Formatter, generate types from the data with JSON to TypeScript, or pull out values with the JSON Path Evaluator.

What this tool does

A JSON Schema is a JSON document that describes what other JSON must look like. The validator reads the draft from the schema's $schema, or from the Draft menu when there is none, resolves $ref to $defs, definitions, $anchor and $id inside the schema, and checks every keyword. It collects all errors instead of stopping at the first (up to 100). Each error has an instance path, a JSON Pointer to the value in your data; a schema path, the location of the keyword that failed; and a message such as must have required property 'id'. When anyOf or oneOf fails, the result also lists why each option failed. Problems in the schema itself, such as an invalid regex, an unknown type name or a $ref to another file, are reported separately, because they mean part of the data could not be checked. Formats are checked by default; turn Check formats off to treat format as an annotation, which is what the 2019-09 and 2020-12 specifications do unless a validator is told otherwise. If either pane is not valid JSON, you get the line and column of the syntax error first.

Example input and output

A wrong type and a missing required property
Input
Schema:
{
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": { "type": "integer" },
    "email": { "type": "string", "format": "email" }
  }
}

Data:
{ "id": "42", "name": "Ada" }
Output
✗ 2 errors
(root)  must have required property 'email'
  required · #/required
/id  must be an integer (got string)
  type · #/properties/id/type

A missing property is reported on the object that should contain it, so its path is the parent: here the root.

Errors inside an array, through a $ref
Input
Schema:
{
  "type": "array",
  "items": { "$ref": "#/$defs/user" },
  "$defs": {
    "user": {
      "type": "object",
      "required": ["id"],
      "properties": {
        "id": { "type": "integer", "minimum": 1 },
        "role": { "enum": ["admin", "editor", "viewer"] }
      },
      "additionalProperties": false
    }
  }
}

Data:
[
  { "id": 1, "role": "admin" },
  { "id": 0, "role": "owner", "nickname": "bo" }
]
Output
✗ 3 errors
/1/id  must be >= 1
  minimum · #/$defs/user/properties/id/minimum
/1/role  must be one of: "admin", "editor", "viewer"
  enum · #/$defs/user/properties/role/enum
/1/nickname  property 'nickname' is not allowed (additionalProperties is false)
  additionalProperties · #/$defs/user/additionalProperties

The schema path points into $defs, where the rule actually lives, not to the $ref that led there.

Extending a schema with allOf and unevaluatedProperties
Input
Schema:
{
  "$defs": {
    "base": { "properties": { "id": { "type": "integer" } } }
  },
  "allOf": [{ "$ref": "#/$defs/base" }],
  "properties": { "name": { "type": "string" } },
  "unevaluatedProperties": false
}

Data:
{ "id": 1, "name": "Ada", "admin": true }
Output
✗ 1 error
/admin  property 'admin' is not allowed (unevaluatedProperties is false)
  unevaluatedProperties · #/unevaluatedProperties

unevaluatedProperties sees id, which the allOf branch declared. With "additionalProperties": false instead, id would be rejected too, and DevPrix warns about exactly that.

Common errors and fixes

"int" is not a JSON Schema type; use "integer"
The seven types are string, number, integer, boolean, object, array and null. Names from programming languages such as int, float, bool or dict are not types, and neither is date: use "type": "string" with "format": "date".
"required" is inside "properties", so it declares a property called "required"
Move "required": ["id", "email"] up one level so it sits next to "properties". The older "required": true on a single property is draft-03 syntax and is ignored by every current draft.
property 'name' is not allowed (additionalProperties is false), although allOf declares it
additionalProperties only counts properties declared in the same schema object, not in allOf, anyOf or a $ref. Use "unevaluatedProperties": false at the top level (2019-09 and later), or repeat the properties next to additionalProperties.
A pattern accepts values you meant to reject
pattern is not anchored: "[0-9]{5}" matches ABC12345XYZ because it contains five digits. Add ^ and $, as in "^[0-9]{5}$", to match the whole string.
"prefixItems" is not part of draft-07 and is ignored
The schema is written for a different draft than the one being used. Set "$schema" to the draft you write: 2020-12 replaced the items array with prefixItems and additionalItems with items, and in draft-07 every keyword next to a $ref is ignored.
$ref "https://example.com/address.json" points outside this schema
DevPrix never fetches other files or URLs, so that part of the data is not checked. Copy the referenced schema into "$defs" and change the reference to "#/$defs/address".
must match format "email", but another validator accepted the same data
Many validators treat format as an annotation unless you enable it: Ajv needs the ajv-formats plugin and Python's jsonschema needs a FormatChecker. Turn off Check formats to see what an annotation-only validator would report.

Common use cases

  • Checking an API request or response body against the schema it is supposed to follow
  • Finding out why a payload fails schema validation in CI, an API gateway or a form library
  • Writing and testing a schema for a JSON config file before you publish it
  • Generating a starter schema from sample JSON and tightening it rule by rule
  • Checking test fixtures and seed data against the schema they must match

Privacy and security notes

  • The schema and the data are validated by JavaScript in this browser tab. Nothing is uploaded, and no network requests are made: even a $ref to a URL is reported instead of fetched.
  • Share copies a link that carries the JSON data after the # in the URL. Browsers do not send that part to servers, but anyone you give the link to can read it, so do not share links that contain secrets.
  • Before pasting production data into any online tool, remove access tokens, passwords and personal data you do not need.

Frequently asked questions

What is the difference between JSON validation and JSON Schema validation?

JSON validation checks syntax: whether the text parses at all, which is what the JSON Validator does. JSON Schema validation starts after that and checks the parsed data against rules, such as which fields are required, their types, allowed values and ranges. This tool shows syntax errors first, then schema errors.

Which JSON Schema drafts does it support?

Draft 2020-12 (the default), 2019-09 and draft-07, read from "$schema" or picked in the Draft menu. That covers $ref, $defs, $anchor, $dynamicRef and $recursiveRef, unevaluatedProperties and unevaluatedItems. Draft-06 schemas are checked with draft-07 rules; draft-04 is not supported, because its exclusiveMaximum and exclusiveMinimum are booleans.

Why does a format pass in one validator and fail in another?

Since draft 2019-09, format is an annotation by default: validators may report it without failing the data, and many only check it when you turn it on. DevPrix checks formats by default; untick Check formats to match an annotation-only validator. It checks the standard formats, including email, date-time, date, time, uri, uuid, ipv4, ipv6, hostname and regex, but not idn-hostname.

Can it follow a $ref to another file or URL?

No. References are resolved inside the schema you paste: "#", JSON Pointers such as "#/$defs/address", $anchor names and $id-based URIs declared in the same document. A reference to another file or URL is listed as a schema problem and that part is not checked. Paste the other schema into "$defs" to include it.

Can I use this instead of Ajv in CI?

Use it to debug a schema or a failing payload quickly; keep a library such as Ajv for JavaScript or jsonschema for Python in CI, so the check runs on every build. The validator passes the required tests of the official JSON Schema Test Suite for these drafts, apart from the few that load remote files, and its paths use JSON Pointer like Ajv's instancePath and schemaPath, though the message wording differs.