JSON Schema Validator

Paste a schema and a document, pick the draft, and the validator checks the document against every keyword your schema uses, type, required, enum, oneOf, $ref, if/then/else, custom format, reporting each violation with a JSONPath-style pointer to the exact offending location.

How to validate against a schema

  1. 1

    Paste the schema

    JSON Schema draft 04, 07 or 2020-12. The `$schema` keyword (if present) auto-selects the draft.

  2. 2

    Paste the document

    The JSON you want to validate. Must be valid JSON first: syntax errors are shown before schema evaluation.

  3. 3

    Validate

    Each violation is reported with a JSON pointer (`/user/email`) and the failing keyword (`format`, `required`, etc.).

  4. 4

    Fix and re-validate

    Edit either side and the status updates live.

Supported keywords

Core: type, enum, const, multipleOf, maximum, minimum, exclusiveMaximum, exclusiveMinimum, maxLength, minLength, pattern, maxItems, minItems, uniqueItems, maxContains, minContains, maxProperties, minProperties, required, dependentRequired.

Composition: allOf, anyOf, oneOf, not.

Applicators: properties, patternProperties, additionalProperties, items, prefixItems, contains, propertyNames.

Conditionals: if, then, else, dependentSchemas.

References: $ref, $defs, $id, $anchor.

Formats (with validation when enabled): date-time, date, time, duration, email, hostname, ipv4, ipv6, uri, uuid, regex.

Error output

FAIL  /user/email        format            "not-an-email" is not a valid "email"
FAIL  /user/age          minimum           -3 is less than the minimum 0
FAIL  /orders/0/total    type              "42" is not of type "number"
FAIL  /                  required          missing required property "shippingAddress"

Every error includes the path and the keyword that failed, making it fast to locate in your editor.

Draft differences that bite

Keyword Draft 04 Draft 07 Draft 2020-12
id vs $id id $id $id
exclusiveMaximum as bool Yes Number Number
items array syntax items items prefixItems
$ref allows siblings No No Yes

Set the right draft; validating a draft-04 schema as 2020-12 will misinterpret id and some other subtleties.

Typical workflows

  • API contract testing: before a deploy, run the generated/updated OpenAPI schema against real sample responses.
  • Config hardening: validate every YAML/JSON config in CI against a schema before merging.
  • Data ingest: reject payloads that do not match the expected shape early, with a clear error message.

Common mistakes

  • Forgetting format enforcement. By default, most validators treat unknown formats as annotation-only. Enable strict-format validation to actually reject bad emails and dates.
  • Overusing oneOf. If two branches of oneOf overlap, the document will fail (it must match exactly one). Use anyOf or discriminator patterns.
  • Tight schemas with additionalProperties: false. Adding a new optional field becomes a breaking change. Omit it unless you truly want a closed object.

Frequently Asked Questions

Yes. Draft 2020-12, 07 and 04 are all supported. The validator reads the $schema keyword from your document to pick the right one, or falls back to the selector in the UI.

Standard formats (email, date-time, uuid, ipv4, etc.) are validated when strict-format is enabled. Custom formats declared in your schema are treated as annotation-only unless you provide a regex with pattern.

Internal references (#/$defs/foo) are resolved automatically. External HTTP references are not fetched by default, for security. Inline your external references first, or use a dedicated tool that supports remote $ref resolution.

Yes. Both the schema and the document stay local. Pasted content is never uploaded, safe for internal API contracts and sensitive data.

Related Tools

Tool available in other languages