JSON Schema Validator
Paste a JSON Schema and a JSON document to check if the data is valid. Get clear errors with the exact data path, the failed keyword and the rule in your schema, all inside your browser.
Validation runs inside your browser. Your schema and data are never uploaded or saved. Only local references that start with # (such as #/definitions/name) are supported.
What Is a JSON Schema Validator?
A JSON Schema validator checks whether a JSON document follows the rules written in a JSON Schema. The schema describes what the data should look like: which properties are required, which types and formats are allowed, how long a string can be, which numbers are accepted and how arrays and nested objects must be built. The validator compares your data with those rules and reports every place where it does not match.
Developers, QA testers and API teams use it to check API requests and responses, configuration files, webhook payloads, form data and database exports. Our free online JSON Schema validator runs in your browser, so you can test a schema against sample data in seconds without installing any software.
How to Validate JSON Against a Schema
- Paste your JSON Schema into the left box, or click Try example to load a sample.
- Paste the JSON data you want to check into the right box.
- The result appears automatically. You can also press Validate JSON at any time.
- If the data is invalid, read the error table. Each row shows the data path, the problem, the keyword that failed and the place in the schema where the rule is written.
- Fix the data or the schema and watch the result update while you type.
What the Validator Checks
The validator supports the core keywords of Draft 4, Draft 6, Draft 7, 2019-09 and 2020-12:
- Types and values: type, enum and const.
- Numbers: minimum, maximum, exclusiveMinimum, exclusiveMaximum and multipleOf.
- Strings: minLength, maxLength, pattern and format (email, uri, date, date-time, time, uuid, ipv4, ipv6, hostname, regex and json-pointer).
- Arrays: items, prefixItems, additionalItems, minItems, maxItems, uniqueItems, contains, minContains and maxContains.
- Objects: properties, patternProperties, additionalProperties, required, propertyNames, minProperties, maxProperties, dependentRequired, dependentSchemas and dependencies.
- Combining schemas: allOf, anyOf, oneOf, not and if/then/else.
- References: local $ref values such as #/$defs/name, #/definitions/name and # for recursive structures.
Understanding the Error Table
Every error has four useful parts. The data path is a JSON Pointer that shows where the problem is in your data, for example /users/0/email. The text (root) means the problem applies to the whole document. The problem column explains what is wrong in plain words, such as Must be at most 120 (found 130). The keyword tells you which rule failed, and the schema path, such as #/properties/age/maximum, shows the exact rule in your schema.
When a rule like anyOf or oneOf fails, the validator also lists the errors from each option so that you can see why none of them matched.
Common JSON Schema Mistakes
- Numbers written as strings. The value “7” in quotes is a string, so it fails type integer. Remove the quotes.
- Missing required properties. A property listed in required must exist, even if its value is empty.
- Unexpected extra properties. When additionalProperties is false, a single typo in a key name is reported as an error.
- Integer and number mix-ups. A value like 1.5 is a valid number but not a valid integer.
- Patterns without anchors. A pattern matches anywhere in the string unless you start it with ^ and end it with $.
- oneOf matching twice. If a value matches more than one schema in oneOf, the check fails. Use anyOf if several matches are fine.
- Invalid JSON. Trailing commas, single quotes and comments are not allowed in JSON. The tool shows the line and column of the problem.
Tips for Writing Better Schemas
Keep schemas easy to maintain by moving repeated parts into $defs and pointing to them with $ref. Set additionalProperties to false on important objects so that typos are caught early. Add minimum, maximum, minLength and maxLength limits wherever the real data has limits, and add a description to every property so that other developers understand the rule. Always test a schema with at least one valid sample and one invalid sample, as this validator lets you do in a few seconds.
Free and Private
The JSON Schema validator is free, needs no account and has no usage limit. Everything happens inside your browser, so your schema and your data are not uploaded, stored or shared. This makes it safe for internal API contracts and test data. Please note that remote references (a $ref that points to a web address) are not downloaded and the unevaluatedProperties and unevaluatedItems keywords are not checked.
Frequently Asked Questions
Is the JSON Schema validator free to use?
Yes. The tool is free, requires no sign-up and has no limit on how often you use it.
Which JSON Schema drafts are supported?
The validator checks the core keywords of Draft 4, Draft 6, Draft 7, 2019-09 and 2020-12. The value of the $schema keyword is accepted, and keywords from all of these drafts are checked together.
Is my JSON data uploaded to a server?
No. All validation happens in your browser. Your schema and data are not sent to any server or saved by the tool.
Can I use $ref to reuse definitions?
Yes. Local references such as #/$defs/name, #/definitions/name and # are supported. References that point to a web address are not downloaded.
Why does a number in quotes fail the integer type?
In JSON, a value in quotes is a string. Type integer only accepts numbers without quotes and without a decimal part, so 7 is valid but the text 7 in quotes and the number 7.5 are not.
Does the tool check the format keyword?
Yes, for common formats such as email, uri, date, date-time, time, uuid, ipv4, ipv6, hostname, regex and json-pointer. Unknown formats are ignored, which the JSON Schema specification allows.
Can I validate large JSON files?
Yes. Documents of a few megabytes are normally checked in a moment. Very large files depend on the memory of your device and browser.
Related Developer Tools
Convert and clean common data formats with these related tools.