JSON Schema Validator
Validate JSON against a JSON Schema and find exactly what needs fixing.
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.
- Paste your JSON data into the left editor.
- Paste the JSON Schema to validate against into the right editor.
- Click Validate.
- Any validation failures list exactly which field failed and why.
- Click Load Sample to see a working data + schema pair.
- 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
{
"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
}{
"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)/agemust be >= 0/roles/1must be equal to one of the allowed values
Most-used JSON Schema keywords
type- string, number, integer, boolean, object, array or nullrequired- properties that must be presentproperties/additionalProperties- the allowed fields of an objectenum/const- a fixed set of allowed valuesminimum,maximum,minLength,pattern- value constraintsitems- 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.