DataFormattools
JSON · Validator

JSON Schema Validator

Validate JSON data against JSON Schema (Draft-07, Draft-04, 2020-12) online using Ajv. Pinpoint missing required fields and type mismatches instantly.

JSON Schema Validator (Ajv Engine)
Provide a JSON Schema and a target JSON document below to validate.
JSON Schema (Draft-07)0 lines
Target JSON Data0 lines
100% In-Browser Privacy: All conversions, formatting, and validations run purely on your machine using client-side JavaScript. Your data, code snippets, and environment variables are never transmitted to any server or recorded in logs.
Specifications

How JSON Schema Validator Works

  • Compiles JSON Schema using industry-standard Ajv validation engine.
  • Validates data types, constraints (e.g. minLength, maximum, pattern), and required keys.
  • Displays detailed error messages indicating the exact JSON path that failed validation.
Demonstration

Example Input & Output

Validates the data payload on the right against the JSON Schema definition on the left using the Ajv validator engine.

JSON Schema (Left)
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "userId": { "type": "integer" },
    "username": { "type": "string", "minLength": 3 }
  },
  "required": ["userId", "username"]
}
JSON Data (Right)
✓ Valid! Data matches the JSON Schema specifications.
Applications

Common Use Cases

API Testing

Verify that API server responses match contractual JSON Schema definitions.

Data Pipeline Ingestion

Ensure incoming batches adhere to required schema constraints before database insertion.

Guidelines

Key Specifications & Gotchas

Schema Syntax Errors

The schema itself must be valid JSON and adhere to standard JSON Schema specifications.

Questions

Frequently Asked Questions

What JSON Schema specifications are supported?

It supports Draft-07, Draft-06, and Draft-04 schema specifications via Ajv.

What errors are reported?

It reports missing required properties, type mismatches, pattern failures, and range violations with JSON path pointers.

Related JSON & Data Format Tools

View all 41 tools →