{}JSONFiddleEditor
Tools/

JSON Schema Validator

Validate JSON data against a JSON Schema (draft-07).

JSON Input
JSON Schema

Click Validate to check the JSON against the schema.

How schema validation actually works here

This tool compiles your JSON Schema into a validation function using Ajv (Another JSON Schema Validator), the same library behind millions of production configs in webpack, ESLint, and VS Code. It supports JSON Schema draft-07 with format validation via ajv-formats -- meaning keywords like "format": "email" or "format": "uri" are enforced, not silently ignored. When validation fails, each error includes the exact instance path (e.g., /orders/0/price) and a human-readable message, so you can pinpoint the offending value without manually tracing nested structures.

Step by step

  1. 1Paste or type your JSON data in the top editor pane.
  2. 2Paste your JSON Schema (draft-07) in the bottom editor pane. The $schema keyword is optional but recommended.
  3. 3Click Validate. Ajv compiles the schema, runs the data through it, and reports all errors at once (allErrors mode).
  4. 4If validation fails, each error shows the instance path and what went wrong -- fix and re-validate.

Under the hood

  • `draft-07` complianceSupports the full draft-07 keyword set: properties, required, additionalProperties, oneOf, anyOf, allOf, if/then/else, $ref (local), const, enum, and more.
  • Format enforcementThe ajv-formats plugin is loaded automatically, so formats like email, uri, date-time, ipv4, ipv6, and regex are validated -- not just accepted as decoration.
  • All-errors modeAjv runs with allErrors: true, meaning it does not bail on the first failure. You see every violation in a single pass.
  • Instance-path error locationsEach error includes the JSON Pointer path to the exact node that failed (e.g., /items/2/quantity), making deep-structure debugging tractable.
  • Dynamic importAjv and ajv-formats are loaded on demand when you click Validate -- they are not part of the initial page bundle.

Where this fits in a workflow

  • API contract testingPaste an API response alongside your OpenAPI-derived schema to verify the response shape before writing integration tests.
  • Config file auditingValidate CI/CD configs, package.json fields, or infrastructure-as-code payloads against their published schemas.
  • Schema authoring feedback loopWrite a schema, paste sample data, iterate until the constraints are tight enough without rejecting valid inputs.
  • Migration verificationAfter transforming data between formats, confirm the output still conforms to the target schema.

Validation example

// Schema (draft-07):
{
  "type": "object",
  "required": ["name", "age"],
  "properties": {
    "name": { "type": "string", "minLength": 1 },
    "age": { "type": "integer", "minimum": 0 },
    "email": { "type": "string", "format": "email" }
  }
}

// Data:
{ "name": "", "age": -5, "email": "not-an-email" }

// Errors reported:
// /name: must NOT have fewer than 1 characters
// /age: must be >= 0
// /email: must match format "email"

Technical questions

Which JSON Schema drafts are supported?

The tool loads Ajv configured for draft-07, which is the most widely used draft. draft-04 schemas often work since draft-07 is largely backward-compatible, but draft-2019-09 and draft-2020-12 keywords (like $dynamicRef or prefixItems) are not supported.

Does $ref resolution work?

Local $ref pointers within the same schema document (e.g., "#/definitions/Address") are resolved by Ajv during compilation. Remote $ref URIs are not fetched -- the tool runs entirely client-side with no network calls.

Is my data sent anywhere?

No. Both the schema compilation and the validation run in your browser via dynamic import. There are no server requests, no telemetry, no logging.

Why does "format" validation fail when other tools ignore it?

Many validators treat format as an annotation-only keyword by default (per the spec). This tool loads ajv-formats explicitly so format checks are enforced, giving you stricter validation.

Related tools