Skip to content
CornerTools

JSON Schema Validator

Validate JSON against a JSON Schema, draft-06 to 2020-12, with every error listed by path.

1
1

Validation result

Paste, type or open a JSON Schema and a JSON instance to validate.

Checks JSON data against a JSON Schema and lists every rule it breaks, with the path to the failing value. It supports drafts 06, 07, 2019-09 and 2020-12, and runs in your browser.

How to use it

Paste, type or open the schema in JSON Schema and the data in JSON instance. The result updates as you type: a confirmation with the draft used, or the number of errors and a table of them with the path, the rule and a message; the lines at fault are highlighted in the data. A syntax error shows under its field, with its line and column, and must be fixed first.

  • Schema draft — Auto-detect reads the $schema URL and falls back to draft 07. A schema that names draft 04 or 03 is reported as unsupported.
  • Fail on additional properties — off by default, as the JSON Schema standard allows extra keys. On, any schema that lists properties without saying otherwise rejects keys it does not list, as if it declared "additionalProperties": false. Schemas combined with allOf, anyOf, oneOf or if/then/else are closed together: the data may hold any key one of them lists.
  • Strict tuple validation — reports tuple schemas that do not fix the array's length.

How validation works

Validation uses Ajv, a widely used JSON Schema validator, and reports all errors rather than stopping at the first. Formats such as email, date, date-time, uri and uuid are checked.

Unknown keywords and ambiguous schemas are listed as warnings below the result, and validation still runs: typos like requried show up rather than silently doing nothing, while annotations such as example or OpenAPI's nullable do not block the check.

Examples

Four rules broken at once

Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": [
    "name",
    "email"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "age": {
      "type": "integer",
      "minimum": 0
    }
  },
  "additionalProperties": false
}
Data
{"name":"","email":"anna@","age":-3,"role":"admin"}
Errors
/role (additionalProperties): must not have property "role"
/name (minLength): must NOT have fewer than 1 characters
/email (format): must match format "email"
/age (minimum): must be >= 0

See also