JSON Schema Validator
Validate JSON data against a JSON Schema. Runs entirely in your browser.
Paste JSON data and a schema
Validation runs automatically as you type
What is JSON Schema?
JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. You define the expected structure — required fields, allowed types, string formats, numeric ranges — and a validator checks whether your data conforms to it. It's widely used for API request/response validation, webhook payload checks, config file validation, and as the schema layer inside OpenAPI.
How to Validate JSON Against a Schema
- 1Paste your JSON data into the left panel
- 2Paste your JSON Schema into the right panel
- 3The validator runs automatically and shows results below
- 4Fix any highlighted errors and re-validate in real time
- 5Click Share to copy a link that reproduces both panels for a teammate
Example
JSON Schema:
{
"type": "object",
"required": ["name", "age"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"age": { "type": "number", "minimum": 0 },
"email": { "type": "string", "format": "email" }
},
"additionalProperties": false
}Valid JSON data:
{ "name": "Ravi", "age": 28, "email": "ravi@example.com" }Invalid JSON data (age is a string, unknown field present):
{ "name": "Ravi", "age": "twenty-eight", "role": "admin" }Where JSON Schema Validation Helps
- ▸API contract testing — Validate real request/response bodies against your OpenAPI-derived schema in CI, so a breaking change to a payload shape fails the build instead of a customer's integration.
- ▸Webhook payload checks — Reject malformed webhooks (Stripe, GitHub, custom integrations) before they reach business logic, with a precise error pointing at the offending field.
- ▸Config file validation — Catch a typo'd key or wrong type in a JSON config file at deploy time instead of a runtime crash in production.
- ▸Reviewing an unfamiliar schema — Paste a schema you inherited alongside a real sample payload to confirm you understand exactly what it does and doesn't enforce.
- ▸Debugging a validation library — Reproduce a confusing Ajv/jsonschema error in an isolated, shareable link before you dig into the library's own error output.
- ▸Learning $ref-based composition — Paste a schema that uses $defs and $ref for shared types (Address, Money, User) and see exactly how the referenced shape gets enforced.
Supported Keywords
type
string, number, integer, boolean, array, object, null — including union arrays
required / properties
Required field names and per-property schemas
additionalProperties
Reject (false) or allow extra fields beyond properties
minProperties / maxProperties
Bound the number of keys on an object
minLength / maxLength / pattern
String length and regex constraints
format
email, uri, date, date-time, ipv4, uuid
minimum / maximum
Inclusive numeric bounds
exclusiveMinimum / exclusiveMaximum
Strict (non-inclusive) numeric bounds
multipleOf
Require the number to be an exact multiple
items / minItems / maxItems / uniqueItems
Array element schema, length bounds, duplicate detection
enum / const
Restrict value to a specific set or single value
allOf / anyOf / oneOf / not
Schema composition, union types and negation
if / then / else
Conditional schema application
$ref / $defs
Internal references like #/$defs/Address for reusable sub-schemas
Understanding Common Validation Errors
| Error keyword | What it means | Typical fix |
|---|---|---|
| type | The value's JSON type doesn't match what the schema declares | Check for a string where a number (or vice versa) was expected — a very common API bug |
| required | A property the schema demands is missing from the object | Add the field, or remove it from required if it's genuinely optional |
| additionalProperties | The data has a key the schema doesn't declare in properties | Fix a typo'd key name, or add the field to properties if it's intentional |
| pattern | A string doesn't match the required regex | Compare the value against the pattern in the Regex Tester to see exactly where it diverges |
| format | A string fails a semantic format check (email, uuid, date…) | Confirm the value is actually well-formed — not just any string |
| oneOf | The value matched zero, or more than one, of the listed sub-schemas | Read the per-branch errors to see which shape the data was meant to satisfy |
Not Yet Supported
This validator covers the keywords used in the overwhelming majority of real-world schemas. A few less common 2020-12 keywords aren't implemented: patternProperties, contains / minContains / maxContains, dependentRequired / dependentSchemas, unevaluatedProperties, and prefixItems(tuple validation instead uses the older draft-07 "items as an array" form). $ref only resolves local pointers within the same document — it does not fetch external schema files over the network. If your production validator (Ajv, jsonschema, etc.) relies on any of these, double-check behavior there before treating this tool as the final word.