JSON Schema Validator
Validate a document against a JSON Schema and read every error with its instance path.
- Recent results are kept in this browser's local storage until you clear them.
History kept on this device
Recent results are kept in this browser's local storage until you clear them. - Processing happens in this page. No application server receives your input.
Runs in your browser
Processing happens in this page. No application server receives your input.
Document
Schema
Validation
Validation results appear here.
What this tool does
Validate checks a JSON document against a JSON Schema and lists every error, each with the path of the value in the document, the keyword that failed and the validator's message. For example, {"price":-1} against {"properties":{"price":{"minimum":0}}} lists one row: /price, /properties/price/minimum and -1 is less than 0.
What it does not do
It does not run as you type, take a second schema field or a pasted-in registry of referenced schemas, offer a download, highlight the failing node, bundle a meta-schema or repair a document. Nothing you paste is sent anywhere.
References
A reference to another schema document, such as $ref with a URL, is reported with the workaround, even when no part of the document uses it, and nothing is ever fetched. Paste the referenced schema inline under $defs and refer to it there. A $dynamicRef is not evaluated, and a warning says so.
Dialects
Drafts 4, 7, 2019-09 and 2020-12 are read, taken from $schema. A schema without one, or with one this validator does not know, is read as 2020-12, and an unknown one adds a warning. A subschema's $schema is not applied, and a warning says so. A dialect changes how the sibling keywords of a $ref read, and how exclusiveMinimum and exclusiveMaximum read, and nothing else, so a keyword its draft does not define, such as prefixItems under draft-07, is still read.
What is refused
A schema is refused, with the keyword named, when it holds a keyword of the wrong type, a value the validator cannot read, a format named after a built-in JavaScript property, an invalid pattern, a reference that leads back to itself without reading further into the document, or a const string longer than 1,024 characters, which you can check with pattern or enum instead.
Reading results
- Patterns run in Unicode mode.
- A known
formatis asserted under every draft, by this validator's own patterns, which can differ from the format's definition:timeneeds no offset,date-timetakes a space, andurlrefuseslocalhostand private addresses. An unknown one passes. - The rows of an
anyOfor aoneOflist alternatives, not all of which must hold. - A repeated key keeps its last value, and a warning appears.
- Numbers beyond 2^53 lose precision, and
1e400reads as infinity.multipleOfallows about 1.2e-7, so a smaller one reads every number as a multiple, and a negative number can read as not a multiple where its positive form is one, as-1does for0.1. unevaluatedPropertiesandunevaluatedItemscan read too loosely beside anifor inside another applicator, and a warning says so.- A property that fails
propertiescan have a second row fromadditionalProperties. containsbesidemaxContainscan report/minContains, which the schema does not hold.- A Message cell holds the interpreter's words, which can misstate a keyword:
Instance does not have at least 1 properties.is how it reportsmaxProperties, and5 is less than 5.how it reportsexclusiveMinimum, so read the Keyword cell. - WebKit's regular expression engine gives up on a catastrophic pattern and reads it as no match, where other engines run on to the time limit.
Limits
Up to 1.0 MB each. A reference to another schema is reported with a workaround and never fetched. The dialect comes from $schema, and 2020-12 is used without one. A run stops after 30 seconds.
| Limit | Value | What happens |
|---|---|---|
| Document size | 1.0 MB | Larger is refused, and nothing is run. |
| Schema size | 1.0 MB | Larger is refused, and nothing is run. |
| Nesting, each side | 64 levels | Deeper is refused, with the position of the opener. |
| Member names, each side | 200,000 | More is refused. |
| Errors listed | 256 | The first are listed, and the sentence gives the true count. |
| Text per field of an error | 2,048 characters | Cut and marked. |
| Text per cell | 500 characters | Cut with an ellipsis. Copy holds the cell text the table shows, so the two agree. |
| An enum or const in a message | 1,024 characters | A longer one is shown as a fixed phrase, and the comparison still uses the real value. |
| The validator's lookup of a schema | 64.0 MB of text | Nested $id keywords and long keys that need more are refused. |
| Weighted failures in one run | 2,000,000 | Past it the run has no verdict. |
| Repeated-key warnings, each side | 1,000 | The rest are counted, not listed. |
| Time | 30 seconds | The run stops, and the next press starts a new one. |
A table cell shows at most 500 characters of any text.
Time and the missing verdict
A run stops after 30 seconds, and a valid document that is slow to check stops there too. Cancel stops a run you started. Sometimes a run has no verdict: βThis validation needed more room than the validator hasβ. It happens with a long list of failures under a wrapping keyword, a long chain of references, a long list of alternatives that pass over an object or an array, a pattern too large to compile, and the failure ceiling. A long key, an echoed value or a long type list under many failures reaches the ceiling sooner. A valid document can reach it too, because what an anyOf discards, what each alternative evaluates and a very long allOf over many items all count.
Storage
The two fields and up to the last runs are kept in this browser's storage, and nothing leaves it. The storage holds 131,072 characters in all, so fields over that still validate and are not kept after a reload. If storage is unavailable or full, every run still completes.
Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.