JSON Schema Validator
JSON Schema Validator
Validate a JSON document against a JSON Schema (draft-07). All validation runs in your browser.
About the JSON Schema Validator
JSON Schema is a vocabulary for describing what valid JSON looks like: which properties are required, what type each value must be, allowed ranges and string patterns, and how nested objects and arrays are structured. It underpins OpenAPI specifications, editor auto-completion for config files, and request validation in many APIs.
This validator checks a JSON document against a schema written for draft-07, using the widely adopted Ajv validation engine in your browser. It reports every error at once, with the path to the failing value and the rule it broke, so you can fix all problems in one pass.
Common uses
- Testing an API request or response against its contract before writing code.
- Developing and debugging a new schema with real sample data.
- Validating configuration files against a published schema.
- Explaining to API consumers why their payload was rejected.
How to use it
- Paste the document into JSON Data and the schema into JSON Schema (or click Try Me).
- Press Validate.
- Fix any errors listed — each shows the path to the problem, such as
/items/0/price.
Example
A schema requiring a positive price, and data that breaks it:
Schema: { "type": "object",
"required": ["name", "price"],
"properties": {
"name": { "type": "string" },
"price": { "type": "number", "minimum": 0 } } }
Data: { "name": "Mouse", "price": -5 }
✗ /price must be >= 0
Tips and common pitfalls
- Set
"additionalProperties": falseto catch misspelled property names — by default, unknown properties are allowed. requiredbelongs to the parent object, not to the property. List required property names in an array.- Use
enumfor fixed sets of values andformat(for example"email"or"date-time") for common string formats. - Reuse definitions with
$refanddefinitionsto keep large schemas maintainable.
Frequently asked questions
Which JSON Schema versions are supported?
The validator targets draft-07, one of the most widely supported versions. Most schemas written for draft-04 and draft-06 also work. Features introduced in 2019-09 and 2020-12, such as unevaluatedProperties, are not supported.
Is my data sent to a server?
No. Validation runs in your browser.
How is JSON Schema related to OpenAPI?
OpenAPI uses a dialect of JSON Schema to describe request and response bodies, so schemas from an OpenAPI file can usually be tested here with small adjustments.
Can I generate a schema from sample JSON?
This tool validates against a schema you provide. Writing the schema yourself gives you control over which fields are required and what values are allowed.