What is JSON Schema?
JSON Schema is a vocabulary, itself written in JSON, that describes the expected shape of a JSON document: which properties exist, their types, which are required, and constraints such as formats, patterns and ranges. Validating a payload against a schema catches contract drift before it reaches users.
How to use JSON Schema Validator
- Paste the JSON document in the first editor and the JSON Schema in the second.
- Click Validate.
- Review the violation table; each row tells you which value failed and why.
JSON Schema Validator features
- Validates against draft-07, 2019-09 and 2020-12 core keywords
- Supports nested objects, arrays, tuples, enums, patterns, formats and numeric limits
- Handles allOf / anyOf / oneOf / not, if-then-else and local $ref
- Lists every violation with JSON path, keyword, message and schema location
- Lints the schema itself and reports unknown types or invalid regular expressions
- Exports violations as CSV
JSON Schema Validator example
Validate a user object
Input:
Document: {"email":"layla@example","age":17}
Schema: {"type":"object","required":["id"],"properties":{"email":{"format":"email"},"age":{"minimum":18}}}Output:
$ required Missing required property "id".
$.email format String is not a valid email.
$.age minimum Value must be ≥ 18.JSON document
Part 1:{ "email": Part 2:"layla@example", "age": Part 3:17 }
JSON Schema
{ "type": "object", Part 1:"required": ["id"], "properties": { "email": { Part 2:"format": "email" }, "age": { Part 3:"minimum": 18 } } }
- 1
required:"id"is missingMissing required property "id".$ → #/requiredFail - 2
format: not a valid emailString is not a valid email.$.email → #/properties/email/formatFail - 3
minimum: 17 is below 18Value must be ≥ 18.$.age → #/properties/age/minimumFail
The example above. Under each message: Path → Schema location, as in the Violations table. A missing property is reported at the object that should contain it, here $.
Frequently asked questions about JSON Schema Validator
Which JSON Schema drafts are supported?
The core keywords of draft-07, 2019-09 and 2020-12: type, properties, required, enum, const, pattern, format, numeric and length constraints, items/prefixItems, contains, allOf/anyOf/oneOf/not, if/then/else, dependentRequired and local $ref.
Are remote $ref references resolved?
Only local references (#/definitions/… and #/$defs/…) are resolved. Remote URLs are not fetched, so inline any external schemas first.
Which string formats are checked?
email, date-time, date, time, uuid, uri, hostname, ipv4, ipv6, regex and json-pointer. Unknown formats are ignored, as the specification recommends.
How are violations reported?
Each violation lists the JSON path of the offending value, the schema keyword that failed, a plain-language message and the location inside the schema.
Technical notes
The validator is a dependency-free implementation that evaluates keywords recursively while tracking both the instance path and the schema path. Sibling keywords next to $ref are evaluated (2019-09+ behaviour), and the OpenAPI nullable extension is honoured.
References
- JSON Schema SpecificationThe vocabulary for describing and validating the shape of JSON documents (types, required properties, formats).
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange FormatThe JSON grammar: objects, arrays, strings, numbers, the three literals, and UTF-8 as the interchange encoding.