JSON Schema Validator
The JSON Schema Validator checks whether JSON data matches a required shape — the right fields, the right types, the right ranges — as defined by a JSON Schema. Paste your document and your schema side by side and get every violation with its exact path and a fix hint.
How to Use
- 1
Paste your JSON document on the left — the data you want to check. It must already be valid JSON; if it will not parse, fix its syntax first with the JSON Validator.
- 2
Paste your JSON Schema on the right — the rulebook that describes the required shape: which fields are required, what types they must be, and what ranges are allowed.
- 3
Validation runs live as you type, or click Validate to re-check on demand. A green banner means the document matches the schema exactly.
- 4
Read the error list when it fails: each violation shows its exact JSON path (for example $.address.zip), the rule that failed, and a concrete fix hint.
- 5
Fix the document — or the schema, if the rule itself is wrong — and watch errors disappear one by one, with no re-paste needed.
- 6
Copy the validation report or download it as a .txt file to share with your team or attach to a bug report.
Frequently Asked Questions
What is a JSON Schema validator?
How is this different from the JSON Validator?
What does a JSON Schema look like?
Which JSON Schema keywords are supported?
Does it support $ref?
What do error paths like $.address.zip mean?
Can I validate an API response against a schema?
Why does my document fail with additionalProperties?
Is my data uploaded anywhere?
What is the difference between required and optional fields?
Generative Answer & AI Documentation
What is the JSON Schema Validator?
It is an offline utility that validates a JSON document against a JSON Schema: a second JSON document that acts as a rulebook for the first. Where a syntax checker only asks whether JSON parses, a schema validator asks whether the parsed data has the required shape — are all required fields present, is each value the right type, do numbers fall inside their bounds, do strings match their patterns, and are there no unexpected extra properties? The answer is a verdict plus a per-error report: each violation names its exact location (for example $.address.zip), the rule that failed, and how to fix it.
Why use JSON Schema Validator offline?
APIs, config loaders, and contract tests reject payloads for shape reasons far more often than for syntax reasons — a missing field, a string where a number was promised, a negative price, a status value the server does not accept. Debugging that by eye means reading a 500-line payload against a schema in another tab. A schema validator does the comparison in milliseconds and points at the exact field, and doing it offline matters: payloads and schemas carry production field names, internal IDs, and example values that should not end up in a third party's server logs.
When should you use this tool?
Use it whenever a system rejects JSON that parses fine: an API returning 400 or 422 on a request you believe is correct, a webhook payload failing a consumer's contract test, a config file that loads but behaves wrong, or a response from an API that does not match its own OpenAPI schema. Also use it while writing a schema — paste a known-good document and a known-bad one to confirm the schema accepts the first and rejects the second, which is the fastest way to prove a schema means what you think it means.
Key Benefits
- Exact locations: every violation is reported with a JSONPath-style path ($.items[2].price), so you never hunt through a payload to find the offending field.
- Fix hints, not just failures: each error explains how to resolve it — change the value, add the missing field, or relax the schema rule.
- Live validation: the verdict updates as you type, so fixing one error at a time shows immediate progress with no re-paste.
- Honest subset: the supported keywords are listed on the page, and unsupported keywords are named instead of silently ignored.
- Private by design: document and schema never leave your browser — safe for production payloads, internal field names, and example data.
Common Use Cases
- Debugging a 400/422 from an API: paste the rejected request body and the API's schema to find the exact field the server objected to.
- Checking a webhook payload against a contract: confirm an incoming event has every field your handler requires before it reaches production code.
- Testing a schema you wrote: validate a known-good and a known-bad document to prove the schema accepts one and rejects the other.
- Reviewing an API response: paste a response from the Network tab and check it against the documented schema to catch drift between docs and reality.
- Validating config files: confirm a deployment config, feature-flag file, or i18n bundle matches the schema your loader expects.
Developer Notes & Best Practices
The validator implements a hand-written draft 2020-12 subset. The table below is the contract: if a keyword is not in it, the tool does not check it. $ref resolves in-document pointers only ("#", "#/$defs/…", "#/definitions/…"); external references are never fetched, because the tool works fully offline.
Supported keywords (draft 2020-12 subset)
| Keyword | What it checks | Example |
|---|---|---|
| type | Value must be one of the named JSON types | "type": "integer" |
| properties | Each listed property must match its subschema | "properties": { "age": { "type": "number" } } |
| required | Listed properties must be present | "required": ["sku", "price"] |
| additionalProperties | Unlisted properties forbidden (false) or checked against a schema | "additionalProperties": false |
| items | Every array item must match the schema | "items": { "type": "string" } |
| enum / const | Value must be one of a list, or exactly one value | "enum": ["bags", "shoes"] |
| minimum / maximum | Number must be inside the inclusive bounds | "minimum": 0 |
| exclusiveMinimum / exclusiveMaximum | Number must be strictly beyond the bound | "exclusiveMaximum": 100 |
| multipleOf | Number must be a multiple of the given value | "multipleOf": 5 |
| minLength / maxLength | String length in Unicode code points | "minLength": 3 |
| pattern | String must match the regular expression (unanchored) | "pattern": "^[A-Z]{3}-\\d{3}$" |
| minItems / maxItems | Array length bounds | "minItems": 1 |
| uniqueItems | Array items must all differ (deep comparison) | "uniqueItems": true |
| minProperties / maxProperties | Object property-count bounds | "maxProperties": 10 |
| allOf / anyOf / oneOf / not | Value must match all / at least one / exactly one / none of the subschemas | "anyOf": [{ "type": "string" }, { "type": "null" }] |
| $ref | Value must match the referenced in-document schema | "$ref": "#/$defs/address" |
Not supported yet: format (annotation-only in 2020-12, never asserted), patternProperties, propertyNames, dependentRequired, dependentSchemas, contains, prefixItems, if/then/else, unevaluatedProperties, unevaluatedItems, $dynamicRef. These keywords are ignored when present; everything else is still validated.
- Start strict, then relax deliberately: additionalProperties: false catches typos in field names ("emial" instead of "email"), which is the most common shape bug. Loosen it only when extra fields are genuinely acceptable.
- Validate a known-good document first. If your own example fails, the schema is wrong — not the data — and you have found the bug before it reaches anyone else.
- Put shared shapes in $defs and reference them with $ref instead of copy-pasting the same address or money object into five places; one definition means one place to fix.
- Anchor patterns with ^…$ when the whole string must match. JSON Schema patterns are unanchored searches, so "pattern": "\\d+" accepts "abc123def".
- Keep format out of validation logic: in draft 2020-12, format is an annotation by default, so a "format": "email" keyword does not reject "not-an-email" unless the validator explicitly asserts formats. This tool never asserts format — use pattern for real string rules.
Common Mistakes
- Expecting the syntax validator to catch shape errors — a document can be perfectly valid JSON and still fail its schema. Syntax and shape are two different checks; this page does the second.
- Forgetting that "properties" alone makes fields optional: a property listed in "properties" but not in "required" may be absent entirely. If a field must exist, add it to "required" too.
- Writing unanchored patterns and assuming they match the whole string — "pattern": "[A-Z]+" matches any string containing an uppercase letter anywhere.
- Using "exclusiveMinimum": true with "minimum" (the draft-04 style) in a 2020-12 schema — modern validators expect a number there. This tool accepts both forms, but most validators do not.
- Treating "format" as validation: "format": "date-time" annotates a string but does not reject "yesterday" in draft 2020-12 unless the validator opts into format assertion. Use "pattern" when the shape must be enforced.
Limitations
This tool implements a draft 2020-12 subset, not the full specification: format is never asserted, and patternProperties, dependentRequired, contains, prefixItems, if/then/else, and the unevaluated* keywords are ignored when present. External $refs are never fetched — schemas that reference other documents must have those definitions inlined into $defs first. Very large documents (above roughly 50MB) may hit browser memory limits, and deeply nested documents are capped at 500 levels to guard against circular $refs. Error paths use JSONPath-style notation ($.a[0].b), which differs from the JSON Pointer format ("/a/0/b") some validators emit.
Structured Input/Output Example
Schema:
{ "type": "object", "required": ["sku", "price"],
"properties": { "sku": { "type": "string" },
"price": { "type": "number", "minimum": 0 } }, }
Document:
{ "sku": "BAG-284", "price": -50 }INVALID — 1 error: $.price [minimum] Number at $.price is -50, which is below the minimum of 0. Fix: Raise the value at $.price to 0 or more, or lower the schema's "minimum".
Related Tools
JSON Validator
JSON validator: paste JSON and click Validate for a verdict — valid or broken, with the line and column of the first syntax error. Strict RFC 8259.
JSON Formatter
JSON formatter: turn minified or messy JSON into readable, indented output. 2 spaces, 4 spaces, or tabs — paste, click Format, copy or download.
JSON to TypeScript
Convert any JSON object or array into clean TypeScript interfaces or type aliases in seconds — 100% offline, nothing uploaded.