JSON Schema Validator
Validate JSON data against a JSON Schema to ensure structure, types, and constraints are correct
Updated
What is the JSON Schema Validator?
The JSON Schema Validator checks a JSON document against a JSON Schema and tells you exactly which parts fail and why. Paste your schema on one side, your data on the other, and get a pass/fail verdict plus a precise list of errors — each pointing at the property path that broke the rule, like user.address.city or tags[2].
It supports the keywords you write day to day: type, required, properties, patternProperties, additionalProperties, string minLength/maxLength/pattern/format, numeric bounds and multipleOf, array items/prefixItems/contains/uniqueItems, the combinators allOf/anyOf/oneOf/not, conditional if/then/else, and $ref pointers into $defs or definitions.
Why it matters
- Catch contract breaks early — confirm an API response or config file matches its schema before it reaches production.
- Debug the schema, not just the data — every violation is listed at once instead of stopping at the first one.
- Draft-aware — switch between Draft 7 and 2020-12 so tuple validation (
itemsarray vsprefixItems) and dependency keywords behave the way your draft specifies. - Nothing leaves your browser — validation runs entirely client-side, so schemas and payloads containing real data stay on your machine.
Tip: When an API integration starts failing, paste the real response alongside the documented schema. The error paths usually point straight at the field the provider changed.
How it works
How JSON Schema Validator Works
Steps
- Choose the draft your schema targets — Draft 7 or 2020-12.
- Paste your JSON Schema into the left editor.
- Paste the JSON data to check into the right editor.
- Read the verdict: a success banner, or one line per violation with its property path.
Validation re-runs on every keystroke, so fixing a rule and watching the error disappear is immediate. Nothing is uploaded — the whole validator runs in your browser.
Behind the scenes
Both inputs are parsed with JSON.parse first. A syntax error in either one is reported on its own, so a malformed brace never masquerades as a schema violation.
The validator then walks the schema and the data together, collecting errors instead of stopping at the first one:
validate(schema, data, path)
├── type / const / enum
├── string → minLength, maxLength, pattern, format
├── number → minimum, maximum, exclusive*, multipleOf
├── array → minItems, maxItems, uniqueItems, contains
│ tuple items, then recurse into each element
├── object → required, properties, patternProperties,
│ additionalProperties, min/maxProperties,
│ dependencies → recurse into each property
├── if / then / else
├── allOf / anyOf / oneOf / not
└── $ref → resolve pointer, recurse
Each recursion carries a path (user.address.city, tags[2]), which is what appears beside every error message.
A few details worth knowing:
integeris a subset ofnumber. A schema of{"type": "number"}accepts42; only{"type": "integer"}rejects4.2.multipleOfis checked by quotient, not remainder.0.3 % 0.1is0.0999…in floating-point arithmetic, so a naive remainder test would wrongly reject0.3againstmultipleOf: 0.1.const,enumanduniqueItemscompare structurally.{"a": 1}equals a separately parsed{"a": 1}, and key order does not make two otherwise-identical objects count as unique.anyOf,oneOf,not, andcontainsare evaluated in a sandbox. Their sub-schemas run against a throwaway error list, so a failed branch ofanyOfnever leaks a misleading error into your results.$refresolution is cycle-safe. Recursive schemas (a tree node containing more tree nodes) validate normally because recursion is driven by your data; a reference that loops without consuming data is reported as a circular reference rather than freezing the page.
Examples
Validate a Person Object
Check if a JSON object matches a schema with required string and integer fields
Detect Type Mismatch
Identify when a value does not match the expected type in the schema
Validate with $ref and $defs
Use schema references to validate nested objects against shared definitions
Array Validation with Constraints
Validate arrays with item schemas, length constraints, and uniqueness requirements
String Format Validation
Validate strings against common formats like email, UUID, and date-time
Frequently asked questions
What is a JSON Schema Validator?
What is a JSON Schema Validator?
It is a tool that checks whether a JSON document obeys the rules described by a JSON Schema. The schema declares what the data should look like — which properties are required, what types they hold, what ranges and formats are allowed — and the validator reports every place the data disagrees.
How do I use it?
How do I use it?
Paste your JSON Schema into the left editor and the JSON data you want to check into the right one. Validation runs as you type. If the data conforms you get a success message; if not, you get one line per violation showing the property path and what went wrong. The "Load" buttons fill both panes with working examples if you want to see the format first.
Which JSON Schema drafts are supported?
Which JSON Schema drafts are supported?
Draft 7 and 2020-12. The toggle above the editors is not cosmetic — it changes how a few keywords are interpreted. In Draft 7, an array-valued items defines a tuple and additionalItems covers the rest; in 2020-12 those roles moved to prefixItems and items. Likewise Draft 7's dependencies was split into dependentRequired and dependentSchemas. Pick the draft your schema was written for.
Which keywords does it validate?
Which keywords does it validate?
Types (including the rule that integer is narrower than number), const and enum, required, properties, patternProperties, additionalProperties, minProperties/maxProperties, string length, pattern and format, minimum/maximum/exclusiveMinimum/exclusiveMaximum/multipleOf, array length, uniqueItems and contains, tuple validation, allOf/anyOf/oneOf/not, if/then/else, boolean schemas (true/false), and $ref pointers within the same document.
Which format values are checked?
Which format values are checked?
email, uri, date, time, date-time, uuid, ipv4, ipv6, hostname, and regex. Any other format value is accepted without a check, which matches the spec: format is an annotation that validators may enforce selectively.
Can it follow $ref to another file or URL?
Can it follow $ref to another file or URL?
No. Only internal pointers such as #/$defs/address or #/definitions/address resolve, because fetching remote schemas would mean sending your document to another server. Inline the referenced definitions into a single schema to validate it here. Self-referential schemas are safe — recursive structures validate normally, and a genuinely circular reference is reported rather than hanging the page.
Why does my object fail with "Additional property is not allowed"?
Why does my object fail with "Additional property is not allowed"?
Because the schema sets "additionalProperties": false, which forbids any property not named in properties or matched by a patternProperties regex. Either add the property to the schema or relax that keyword.
Is it free, and is my data private?
Is it free, and is my data private?
Yes to both. Validation runs entirely in your browser with no server calls, so schemas and payloads — including anything confidential — never leave your machine.
Related tools
More utilities you might find handy.
.env File Generator
Quickly generate clean, properly-quoted .env files from key-value pairs — no more quoting errors or broken deployments.
.htaccess Redirect Builder
Generate error-free Apache .htaccess code for 301 redirects, HTTPS enforcement, and canonical URL routing.
ASCII Converter – Text to ASCII, Hex, Binary & Back
Convert text to ASCII codes and decode back in decimal, hex, binary, or octal — live, private, and 100% browser-based.