JSON Schema Validator

Validate JSON against a schema with Ajv — the fastest open-source validator. Drafts 04 through 2020-12. Runs entirely in your browser.

SCHEMAdraft 2020-12
DATAJSON to validate

Why schema-validate at the boundary

Validate inputs as they enter your system — API request body, file upload, message queue payload — and the rest of the code can trust its data. Skip this step and every consumer function ends up sprinkled with if (typeof x === 'string') defensive checks.

JSON Schema is the lingua franca for this: OpenAPI uses it for request and response shapes, AsyncAPI for message contracts, npm uses a subset for package.json, and most cloud providers use it for resource definitions. One schema, validators in every major language.

Ajv performance

Ajv compiles a schema into a JavaScript function that runs at near-native speed — typically 50-200× faster than naive interpreters. For high-throughput APIs the compile cost is one-time; the validation itself is essentially free.

Privacy first

Both your schema and your data stay in this browser tab. Validation runs locally. Nothing crosses the network, nothing is logged.

Common questions

What is JSON Schema?
JSON Schema is a declarative language for describing the structure of a JSON document — required fields, value types, formats, constraints. It separates the shape of valid data from the code that consumes it, so you can validate inputs at the boundary instead of scattering checks throughout your codebase.
Which draft does this validator support?
This tool uses Ajv, the fastest open-source JSON Schema validator. It supports drafts 04, 06, 07, 2019-09, and 2020-12. The draft is detected from the schema's $schema property, with 2020-12 as the default.
What formats are recognized?
The "format" keyword recognizes email, uri, uuid, date, date-time, time, ipv4, ipv6, hostname, regex, and several others via ajv-formats. Use these for common patterns instead of writing your own regex.
What does additionalProperties: false do?
It rejects any property not declared in the schema. This catches typos in keys — without it, sending {"emial": "x"} would pass validation because the misspelled "emial" is ignored. Set it on every object you control.
How is this different from TypeScript or Zod?
TypeScript checks at compile time and disappears at runtime. JSON Schema and Zod check at runtime. JSON Schema is portable across languages (Python, Go, Rust, Java all have validators) and is the format used by OpenAPI, AsyncAPI, and most config tools. Zod is JavaScript-only but generates types automatically.
Is my data private?
Yes. Both the schema and the data stay in your browser. Ajv compiles the schema into a JavaScript validation function locally, then runs it against your data. Nothing is uploaded.