JSON Schema Validator
Paste a JSON Schema on the left and your JSON data on the right. Validation runs as you type with the Ajv engine, and every error shows the JSON pointer, the failing keyword and the line it is on. Click an error to jump to it.
Last updated:
How to use the JSON Schema Validator
- Paste your JSON Schema in the left editor, or upload a .json schema file. Pick a sample to start from an example.
- Paste the JSON data you want to check in the right editor.
- Choose the draft or leave it on Auto to use the
$schemakeyword. Validation runs as you type. - Read the result. Green means the data is valid. Otherwise each error lists the JSON pointer, the message and the schema keyword that failed.
- Click an error to select the offending value in the data editor, fix it and watch the list update.
JSON Schema keywords at a glance
A JSON Schema is itself a JSON object made of keywords. Each keyword adds one rule, and the data is valid only when every rule passes. These are the keywords you will use most:
| Applies to | Keywords | Example |
|---|---|---|
| Any value | type, enum, const | {"type": ["string", "null"]} |
| Strings | minLength, maxLength, pattern, format | {"type": "string", "format": "email"} |
| Numbers | minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf | {"type": "integer", "minimum": 0} |
| Objects | properties, required, additionalProperties, patternProperties, propertyNames, minProperties | {"required": ["id"], "additionalProperties": false} |
| Arrays | items, prefixItems, minItems, maxItems, uniqueItems, contains | {"type": "array", "items": {"type": "string"}} |
| Combining | allOf, anyOf, oneOf, not, if / then / else | {"anyOf": [{"type": "string"}, {"type": "number"}]} |
| Reuse | $ref, $defs (2019-09+), definitions (draft-07), $anchor | {"$ref": "#/$defs/address"} |
Reading the error list
Each error has three parts. The path is a JSON Pointer to the value in your data, for example /items/1/price is the price of the second item. The keyword is the schema rule that failed, such as required or pattern. The schema path points to that rule inside the schema, such as #/$defs/item/properties/price/minimum, so you can tell whether the data or the schema needs fixing.
When a value fails anyOf or oneOf, the validator lists why each branch failed (indented) followed by the summary error. Usually only one branch was meant to apply, so look for the errors under the branch that matches your intent. A common trick is adding a const discriminator, such as "type": {"const": "click"}, to every branch.
Common schema mistakes
- Typos in keywords are silently ignored.
"minLenght": 3or"require": ["id"]are unknown keywords, so nothing is checked. If a rule seems to have no effect, check the spelling. requiredbelongs to the object, not the property. Write{"properties": {"id": {...}}, "required": ["id"]}, not{"id": {"required": true}}(that was draft-03 syntax).additionalProperties: falsedoes not see throughallOf. Properties declared in another subschema count as additional. UseunevaluatedProperties: false(2019-09 and later) when combining schemas.- Array-form
itemsis a tuple only before 2020-12. In 2020-12 useprefixItemsfor positions anditemsfor the rest. integeraccepts 1.0. JSON Schema compares numbers mathematically, so 1.0 is a valid integer but 1.5 is not.
Frequently asked questions
What is a JSON Schema validator?
It checks whether a JSON document matches the rules in a JSON Schema: the required properties, data types, allowed values, string patterns, number ranges and array lengths. The result is either valid or a list of every rule the data breaks.
Which JSON Schema drafts are supported?
Draft-07 (which also covers most draft-04 and draft-06 schemas), draft 2019-09 and draft 2020-12. Leave the draft on Auto and the validator reads the $schema keyword; a schema without $schema is treated as draft-07.
What does the error path mean?
The path is a JSON Pointer (RFC 6901) to the value that failed. /items/2/price means the price property of the third element of the items array; an empty path means the root value. The schema path shows which keyword in the schema produced the error.
Are formats like email and date-time checked?
Yes, when Check formats is on. The validator understands date, time, date-time, duration, email, hostname, ipv4, ipv6, uri, uri-reference, uuid, regex and json-pointer. In the JSON Schema standard, format is only an annotation unless the validator chooses to assert it, so you can switch it off.
Can it resolve $ref to other files or URLs?
It resolves references inside the same schema, such as #/definitions/address, #/$defs/item, $anchor names and $id-based references. Remote references to other files or URLs are not downloaded, so inline those definitions under $defs first.
What is the difference between draft-07 and 2020-12?
2020-12 renamed definitions to $defs, replaced array-form items with prefixItems, split dependencies into dependentRequired and dependentSchemas, and added unevaluatedProperties, unevaluatedItems, minContains and maxContains. Draft 2019-09 introduced most of these changes.
Is my data sent to a server?
No. The schema and the JSON are validated by JavaScript in your browser, so private API payloads and configuration files never leave your device.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.