JSON Schema Validator

Validate JSON against a JSON Schema and find exactly what needs fixing.

input.json
schema.json
Ctrl + Enter

About the JSON Schema Validator

Check whether a JSON document actually conforms to a JSON Schema - useful for validating API payloads and config files before they cause a bug.

🛠️
How to use it
  1. Paste your JSON data into the left editor.
  2. Paste the JSON Schema to validate against into the right editor.
  3. Click Validate.
  4. Any validation failures list exactly which field failed and why.
  5. Click Load Sample to see a working data + schema pair.
💡
Tips & use cases
  • Use this to enforce a data contract on an API response before shipping a change.
  • A schema can require specific types, value ranges, string patterns, and which fields are mandatory.
  • See our JSON Schema Best Practices guide for how to write good schemas.

Validate JSON Against a JSON Schema

A JSON Schema describes what valid JSON looks like: which fields are required, what type each value must be, and which values are allowed. This JSON Schema validator checks your data against a schema and lists every error with the exact path that failed.

🧪

JSON Schema validation example

Schema
{
  "type": "object",
  "properties": {
    "name":  { "type": "string", "minLength": 1 },
    "age":   { "type": "integer", "minimum": 0 },
    "email": { "type": "string" },
    "roles": {
      "type": "array",
      "items": { "enum": ["admin", "editor", "viewer"] }
    }
  },
  "required": ["name", "email"],
  "additionalProperties": false
}
JSON data
{
  "name": "Alice",
  "age": -3,
  "roles": ["admin", "owner"],
  "nickname": "Al"
}

Validating this data against the schema reports four errors:

  • (root) must have required property 'email'
  • (root) must NOT have additional properties (nickname)
  • /age must be >= 0
  • /roles/1 must be equal to one of the allowed values
🔑

Most-used JSON Schema keywords

  • type - string, number, integer, boolean, object, array or null
  • required - properties that must be present
  • properties / additionalProperties - the allowed fields of an object
  • enum / const - a fixed set of allowed values
  • minimum, maximum, minLength, pattern - value constraints
  • items - the schema every array item must match

JSON Schema validator FAQ

Which JSON Schema versions are supported?

Draft-07, 2019-09 and 2020-12. The draft is detected from the schema's $schema (for example "https://json-schema.org/draft/2020-12/schema"); you can also pick it in the menu above the schema editor. Schemas without $schema use draft-07.

Is the "format" keyword checked?

Yes. Common formats such as email, date-time, date, uri, uuid and ipv4 are validated. For anything else, use pattern with a regular expression.

What does an error path like /roles/1 mean?

It's a JSON Pointer to the failing value: /roles/1 is the second item of the roles array. (root) means the error is on the top-level object, such as a missing required property.

Is my JSON uploaded to a server?

No. Validation runs entirely in your browser.