Skip to main content
Yoryantra
← Back to Tools

JSON Schema Validator

Check JSON instances against a careful Draft 2020-12 subset with path-level failures.

Validation result

Path-level validation failures will appear here.

Browser-side boundary

Instance and schema text are parsed and validated by this page. The component does not send either input to a validation API. Copy only writes the result to your browser clipboard when you press Copy.

Not a full JSON Schema implementation

Validation follows Draft 2020-12 semantics only for the keywords listed below. Dynamic references, unevaluated* keywords, custom vocabularies, external references, and format assertions are outside this browser implementation. Use a standards-compliant library for release gates or schemas that depend on those features.

Valid JSON can still be the wrong data

JSON syntax answers one question: can the text be parsed? A schema answers different questions: must an object contain a particular member, may an array contain only strings, is a number inside an accepted range, or can extra properties appear at all?

A failed path points to the instance location that broke an assertion. That distinction matters when a payload is syntactically fine but an API, configuration loader, or test fixture still rejects its shape.

What is evaluated here

Values and scalars

type, enum, const, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, minLength, maxLength, and Unicode-aware pattern checks.

Objects

required, properties, patternProperties, additionalProperties as a boolean or subschema, propertyNames, minProperties, maxProperties, dependentRequired, and dependentSchemas.

Arrays

prefixItems, items, contains, minContains, maxContains, minItems, maxItems, and uniqueItems without changing array order.

Schema composition

allOf, anyOf, oneOf, not, if/then/else, boolean schemas, $defs, and local JSON Pointer $ref values such as #/$defs/address.

The schema is checked before the instance

A validator should not quietly interpret malformed schema keywords. This page rejects the wrong keyword types, negative length limits, duplicate required names, invalid regular expressions, non-positive multipleOf values, unsupported dialect declarations, unresolved local references, and features whose validation meaning it cannot implement faithfully.

It also stops duplicate JSON member names and conservatively rejects numbers that JavaScript would not preserve safely. Otherwise JSON.parse could discard a duplicate member or round a precision-sensitive value before schema evaluation even begins.

Draft 2020-12 changed how tuple arrays are written

In Draft 2020-12, prefixItems describes positional tuple entries and items applies to entries after that prefix. Older drafts used the items/additionalItems pairing differently, which is why this page rejects schemas that explicitly declare an older dialect rather than guessing at their meaning.

String length is not JavaScript string.length

JavaScript counts UTF-16 code units. JSON Schema length assertions count JSON string characters, so supplementary Unicode characters must not be counted twice. The validator counts Unicode code points for minLength and maxLength rather than using the raw JavaScript length property.

References deliberately stop at the browser boundary

Local references such as #/$defs/profile are resolved inside the pasted schema. Remote URLs and named anchors are rejected instead of being fetched or silently ignored. That keeps validation deterministic and avoids making network requests just because a pasted schema contains a reference.

Regular expressions deserve caution

Draft 2020-12 patterns use ECMA-262-style regular expressions and are not implicitly anchored. JavaScript cannot reliably time-box a pathological regular expression on the main thread, so schemas from untrusted sources can still create expensive pattern work. Pattern length is capped here, but that is not a complete ReDoS defense.

Where the specification draws the line

JSON Schema’s current published version is Draft 2020-12. The official validation specification defines assertions such as type, numeric bounds, string lengths, array limits, required members, and dependentRequired; the core specification defines applicators and reference behavior. For a production validator, those documents and the official meta-schema are the source of truth.

Official references: Draft 2020-12 Validation and Draft 2020-12 Core.