Validate JSON against a Schema (Draft-07 / 2020-12) with field-level error paths.

Switch tool
JSON Schema
0 chars · 0 lines
JSON data
0 chars · 0 lines

How to use

Purpose

JSON Schema validator covering Draft 7, 2019-09, and 2020-12. Validates JSON data against a schema and reports field-level violations. Also infers a draft schema from existing JSON, useful for bootstrapping API contracts. Common uses: enforcing API contracts, validating config files, runtime form validation, data migration verification. Error paths are precise (user.address.zipCode) for fast debugging. All validation runs locally in the browser.

Steps

  1. Paste a JSON Schema in the left pane (or import a .json schema file)
  2. Paste the JSON data to validate in the right pane
  3. Click Validate for instant pass/fail; failures list every violating field path with the exact reason
  4. Reverse: paste data into the right pane and click Infer Schema for an auto-generated draft
  5. Schema drafts support nested objects, array types, enum, format (email/date-time/uri)
  6. Toggle Draft version: Draft 7 (default and most common), 2019-09, or 2020-12
  7. $ref to local definitions works natively; external URL refs need CORS-allowing servers
  8. Export pass/fail JSON report for CI integration

FAQ

Is JSON Schema the same as the OpenAPI schema?
Mostly compatible. OpenAPI 3.1 fully aligns with JSON Schema 2020-12; OpenAPI 3.0 uses a subset with a few non-standard keywords (e.g. nullable). Default is Draft 7; for OpenAPI 3.1 use 2020-12.
Are all inferred fields marked as required?
Default inference marks every observed field as required (conservative). Toggle non-required fields manually. Inference has Strict (required + enum) and Loose (type only) presets.
How do I validate objects inside arrays?
Use items: {"type":"array","items":{"type":"object","properties":{...}}}. Error paths include array indices: user.tags[2].name.
How are format keywords like "email" and "date-time" validated?
format is optional but enabled by default using ajv-formats (email, uri, uuid, date, date-time, ipv4, ipv6, hostname). Disable in options if you only want format as documentation.
How do I use external $ref?
Local $ref (#/definitions/User) works out of the box. External URL $ref requires the target server to send proper CORS headers. For reliable CI, bundle all schemas into one file using $defs and local refs.

Use cases

  • API contracts: backend defines schema, frontend writes types from it, CI validates payloads to prevent drift
  • API doc automation: validate OpenAPI/AsyncAPI example payloads against their schemas
  • Config validation: project config.json constrained by a schema so new contributors cannot break it
  • Data migration verification: write a schema for the new format and validate migrated data
  • Server-side form validation: re-validate client JSON on the server to prevent frontend bypass

Use cases

Frontend-backend API contracts, OpenAPI example validation, config schema enforcement, data migration verification, server-side form validation. Backend, frontend, API designers, QA. Multi-Draft support, reverse schema inference, and precise field-path errors are the differentiators.