Paste a JSON document and a JSON Schema to test validity instantly. Get precise error paths (JSON Pointer, e.g. $.users[2].email) — not a bare "invalid". Supports draft 2020-12, 2019-09 and Draft-07, $ref, format assertions, and YAML schemas.
Type or paste a schema and a JSON document, then validate.
A JSON Schema validator checks whether a JSON document conforms to a JSON Schema: a declarative contract describing the allowed structure, data types, required fields, value ranges, string patterns, and formats. Think of it as "TypeScript types for JSON data at runtime".
Common uses:
JSON validator vs JSON Schema validator: a plain JSON validator (or "JSON checker") only verifies syntax — is it well-formed JSON? A JSON Schema validator goes further and verifies semantics against your schema: right types, required fields present, numbers in range, strings matching patterns, emails that look like emails.
The validator walks the JSON document and the schema in parallel. For every value it applies the schema keywords that target it:
type checks the value's kind (object, array, string, number, integer, boolean, null).properties, required, additionalProperties, patternProperties) check each member.items/prefixItems, minItems, uniqueItems) check each element.minLength, pattern, minimum, multipleOf, format) constrain the value itself.allOf, anyOf, oneOf, not, if/then/else) compose schemas.Every violation is reported with the JSON Pointer path of the failing value — e.g. $.users[2].email — so you know exactly where it broke. Enable Explain mode above and each error is also translated into plain language ("The value at $.age is out of the allowed numeric range: -5 is less than the minimum 0.").
Try the Sample dropdown, then "Load failing example" to see precise error paths in action. Toggle "Enforce format" off if your schema uses format only as documentation (per spec, format is annotation-only by default; this tool lets you opt into assertion).
The six JSON types plus integer: object, array, string, number, integer, boolean, null. Key constraining keywords:
{
"type": "object",
"properties": {
"name": { "type": "string", "minLength": 1, "maxLength": 80 },
"code": { "type": "string", "pattern": "^[A-Z]{2}-\\d{4}$" },
"price": { "type": "number", "exclusiveMinimum": 0, "multipleOf": 0.01 },
"tags": { "type": "array", "items": { "type": "string" },
"minItems": 1, "uniqueItems": true },
"role": { "enum": ["admin", "editor", "viewer"] },
"kind": { "const": "user" }
},
"required": ["name", "role"],
"additionalProperties": false
}
The value must match one or more subschemas. Use for overlapping alternatives.
{"anyOf": [
{"type": "string"},
{"type": "string",
"format": "email"}
]}"a@b.co" matches both — fine.
The value must match precisely one subschema. Use for mutually exclusive variants; the validator tells you if zero or several matched.
{"oneOf": [
{"type": "object",
"properties": {
"w": {"type": "number"},
"h": {"type": "number"}},
"required": ["w","h"]},
{"const": "digital"}
]}allOf requires matching every subschema (great for mixing reusable fragments); not forbids matching a subschema.
$ref reuses a schema defined elsewhere — no copy-paste. This tool resolves internal references: local JSON Pointers (#/$defs/address), relative refs, plain-name anchors ($anchor), and the draft-specific dynamic keywords $dynamicRef (2020-12) and $recursiveRef (2019-09).
{
"$defs": {
"address": {
"type": "object",
"properties": {
"street": { "type": "string" },
"zip": { "type": "string", "pattern": "^\\d{5}(-\\d{4})?$" }
},
"required": ["street", "zip"]
}
},
"type": "object",
"properties": {
"home": { "$ref": "#/$defs/address" },
"work": { "$ref": "#/$defs/address" }
}
}
Remote $ref (http/https URLs) is intentionally not fetched — the tool is 100% offline, so there is no network to fetch with. Inline the referenced schema into $defs instead. Circular $refs are handled safely.
By default, objects may contain properties not listed in properties. Set "additionalProperties": false for a strict schema that rejects unknown keys — the error names the offending property. Use patternProperties when extra keys are allowed but must follow a shape:
{
"type": "object",
"properties": { "name": { "type": "string" } },
"patternProperties": { "^x-": { "type": "string" } },
"additionalProperties": false
}
Here x-anything keys are allowed (and must be strings); any other undeclared key fails. Draft 2020-12 also offers unevaluatedProperties, which understands allOf/oneOf compositions — both are supported by this validator.
For rules like "conditional required" — field B is required only when field A has a certain value — use if/then/else:
{
"type": "object",
"properties": {
"country": { "type": "string" },
"postalCode": { "type": "string" }
},
"if": { "properties": { "country": { "const": "USA" } },
"required": ["country"] },
"then": { "properties": { "postalCode":
{ "pattern": "^\\d{5}(-\\d{4})?$" } } },
"else": { "properties": { "postalCode": { "minLength": 3 } } }
}
For simpler co-occurrence ("if credit_card is present, billing_address is required"), dependentRequired: { "credit_card": ["billing_address"] } (2020-12; dependencies in Draft-07) is enough. Try the if/then/else sample above.
Properties are optional by default — only names listed in required must appear. To additionally allow an explicit null value (a "string or null" field), widen the type:
{
"type": "object",
"properties": {
"nickname": { "type": ["string", "null"] },
"email": { "type": "string", "format": "email" }
},
"required": ["email"]
}
{"email": "a@b.co"} is valid (nickname omitted); {"email": "a@b.co", "nickname": null} is valid; {"email": "a@b.co", "nickname": 42} fails.
Nest properties to any depth; describe each array element with items. Error paths track the full descent — $.orders[0].lines[2].price:
{
"type": "object",
"properties": {
"customer": {
"type": "object",
"properties": {
"name": { "type": "string" },
"address": { "$ref": "#/$defs/address" }
},
"required": ["name"]
},
"orders": {
"type": "array",
"items": {
"type": "object",
"properties": {
"sku": { "type": "string", "pattern": "^[A-Z0-9-]+$" },
"price": { "type": "number", "minimum": 0 }
},
"required": ["sku", "price"]
},
"minItems": 1
}
},
"required": ["customer", "orders"]
}
With "Enforce format" enabled, string formats are asserted (disable it to treat them as annotations, per the spec default):
| Format | Example (valid) | Notes |
|---|---|---|
email | ada@example.com | RFC 5322 dot-atom / quoted-string / domain-literal |
date | 2026-10-06 | Real calendar dates incl. leap years |
time | 23:59:60Z | Leap second only at 23:59:60 UTC |
date-time | 2026-10-06T14:30:00+07:00 | RFC 3339, timezone required |
duration | P1Y2M3DT4H | ISO 8601, strict grammar |
uri / uri-reference | https://example.com/a?b=c | RFC 3986 parser (userinfo, pct-encoding, IP literals) |
hostname / idn-hostname | münchen.de (idn) | UTS-46 mapping + IDNA2008 checks |
ipv4 / ipv6 | 192.168.0.1 / ::1 | Strict dotted-quad / compressed forms |
uuid | 123e4567-e89b-12d3-a456-426614174000 | Any version, canonical form |
regex | ^[a-z]+$ | Must compile as ECMA-262 regex |
json-pointer | /users/0/email | RFC 6901 syntax |
String patterns use the pattern keyword with regex (ECMA-262): { "type": "string", "pattern": "^[a-z0-9-]+$" }.
JSON is valid YAML, and schemas are often authored in YAML for readability. Check "Schema is YAML" and paste a YAML schema — mappings, nested blocks, and sequences are converted before validation:
type: object
properties:
name:
type: string
minLength: 1
email:
type: string
format: email
tags:
type: array
items:
type: string
required:
- name
- email
additionalProperties: false
Flow collections (type: [string, "null"]), quoted strings, numbers, booleans, and comments are supported. The instance document stays JSON.
| Feature | Draft-07 | 2019-09 | 2020-12 |
|---|---|---|---|
| Reusable definitions | definitions | $defs | |
| Dynamic references | — | $recursiveRef / $recursiveAnchor | $dynamicRef / $dynamicAnchor |
| Array tuple keyword | items (array form) | prefixItems | |
| Strict extras | additionalProperties | + unevaluatedProperties | |
| Dependencies | dependencies | dependentRequired / dependentSchemas | |
Sibling $id + $ref | $ref wins (id ignored) | $id applies | |
Pick the draft your schema declares via $schema (the toolbar selector overrides for testing). All three are fully supported, including the tricky bits: outermost-wins $dynamicRef, $recursiveRef scoping, and unevaluated* evaluation tracking.
OpenAPI 3.1 schemas are a dialect of JSON Schema draft 2020-12 — paste them here and they validate directly (including $defs, prefixItems, and const). OpenAPI 3.0 uses an older subset: replace $defs with definitions, rewrite boolean exclusiveMinimum/exclusiveMaximum as numbers, and note that 3.0's nullable: true becomes "type": ["string", "null"].
JSON Schema has no standard errorMessage keyword (that's an AJV extension). The portable approach: use Explain mode in this tool, which renders every failure as a human sentence with its exact path — or add title/description annotations to document intent for API consumers.
| This tool | jsonschemavalidator.net | extendsclass / codebeautify | AJV (library) | |
|---|---|---|---|---|
| Price | Free, no signup | Free | Free | Free (MIT) |
| Drafts | 2020-12 · 2019-09 · Draft-07 | Older drafts | Varies / thin | All (separate builds) |
| Precise error paths | JSON Pointer + click-to-jump | Generic messages | Basic | Via code |
| Explain mode (plain language) | Yes | No | No | No |
| YAML schemas | Built in | No | No | Needs plugin |
| Works offline / private | Zero network requests | Server round-trip | Ads + tracking | Local code |
| Spec-test-suite score | 99.87% (6032 tests) | Unpublished | Unpublished | ~100% |
A JSON Schema validator tests documents against a schema; a generator creates a schema from sample JSON (or sample data from a schema). Different intents — this page is the validator. If you need the other direction, nrtechstudio.com also hosts a JSON-to-JSON-Schema generator and a JSON Schema viewer.
A JSON Schema validator checks whether a JSON document conforms to a JSON Schema — a contract describing allowed structure, types, and constraints. It is used to validate API requests and responses, configuration files, and data pipelines before bad data causes failures.
The validator walks the JSON document and the schema together, applying each keyword (type, properties, required, items, pattern, format, etc.) to the matching value. Every violation is reported with the JSON Pointer path of the failing value, e.g. $.users[2].email.
Draft 2020-12, draft 2019-09, and Draft-07. Select the draft in the toolbar; keywords like $dynamicRef (2020-12) or $recursiveRef (2019-09) behave per their specification.
Yes — internal $refs such as #/$defs/address, relative refs, JSON Pointer fragments, anchors ($anchor), and draft-specific $dynamicRef/$recursiveRef are resolved. Remote $refs over http(s) are not fetched, because the tool works 100% offline; inline the referenced schema instead.
anyOf requires the value to match at least one subschema; oneOf requires it to match exactly one. Use anyOf for overlapping alternatives and oneOf for mutually exclusive variants.
Fields are optional by default — only properties listed in required must be present. To allow an explicit null, use "type": ["string", "null"].
Describe nested objects with properties inside properties, and arrays of objects with "items": { "type": "object", "properties": {...} }. Errors include the full path, e.g. $.orders[0].price.
With format enforcement enabled: email, date, time, date-time, duration, uri, uri-reference, uri-template, hostname, idn-hostname, ipv4, ipv6, uuid, regex, and json-pointer.
Yes. Enable YAML mode and paste a YAML schema (mappings, sequences, nested blocks); it is converted to JSON before validation. JSON itself is also valid YAML.
Yes. The page is a single self-contained file with zero network requests — validation runs entirely in your browser, so it works offline and your data never leaves your device.
A JSON validator only checks syntax (is it well-formed JSON?). A JSON Schema validator additionally checks semantics against a schema: correct types, required fields, value ranges, patterns, and formats.
OpenAPI 3.1 schemas are a dialect of JSON Schema draft 2020-12 and validate directly. OpenAPI 3.0 uses an older subset (no $defs, boolean exclusiveMinimum); convert or adjust those keywords first.
if tests a condition schema; when it matches, then must also validate, otherwise else applies — e.g. "if country is USA then postalCode must match a US ZIP pattern".
Yes — free, no signup, no usage limits, no data uploaded. The validation engine passes 99.87% of the official JSON-Schema-Test-Suite (6032 tests).
The engine is verified against the public JSON-Schema-Test-Suite: 6024 of 6032 tests pass (99.87%). The remaining failures are remote $refs (not fetched, by design — the tool is offline) and custom-vocabulary meta-validation.
Free tool by NRTechStudio
Explore similar developer tools and calculators. 100% free, accurate, and runs completely in your browser without sign-up.
2 taps, no typing needed — diagnostics are sent automatically.