Free Online JSON Schema Validator
Validate any JSON document against a JSON Schema β instantly, with detailed error reporting for every constraint violation.
JSON Schema is a powerful standard for describing the structure, types, and constraints of JSON data. It acts as a "blueprint" or contract that your JSON must follow. This tool uses Ajv β the most popular and standards-compliant JSON Schema validator β to validate your data and report errors with exact field paths and human-readable messages.
What Is JSON Schema?
A JSON Schema is itself a JSON document that defines the rules for another JSON document. For example:
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"required": ["name", "email", "age"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 0, "maximum": 150 }
},
"additionalProperties": false
}
This schema says: the JSON must be an object, with required fields name, email, and age of specific types and constraints β and no extra fields allowed.
When Should You Use JSON Schema Validation?
- Testing API request/response payloads during development
- Validating configuration files (CI/CD pipelines, app configs)
- Enforcing data contracts between microservices
- Checking mock data matches your TypeScript interfaces
- Debugging why a JSON payload is being rejected by your backend
- Generating documentation from schemas (OpenAPI, Swagger)
Supported JSON Schema Drafts
- Draft-07 β Most widely used; supported by almost all tooling
- Draft 2019-09 β Adds
$anchor,unevaluatedProperties, and more - Draft 2020-12 β Latest standard with
prefixItemsfor arrays
Common JSON Schema Keywords
| Keyword | Purpose | Example |
|---|---|---|
type | Data type constraint | "type": "string" |
required | Mandatory keys on an object | "required": ["id","name"] |
properties | Object property definitions | "properties": {"id": {"type":"integer"}} |
minimum / maximum | Numeric range | "minimum": 0, "maximum": 100 |
minLength / maxLength | String length | "minLength": 3, "maxLength": 50 |
pattern | Regex pattern for strings | "pattern": "^[A-Z]{2}\\d{6}$" |
format | Semantic format (email, date, uriβ¦) | "format": "email" |
enum | Allowed values list | "enum": ["active","inactive","pending"] |
additionalProperties | Allow/block extra keys | "additionalProperties": false |
items | Array item schema | "items": { "type": "string" } |
Pro Tips
- Use "Generate from Data" to auto-create a base schema from your JSON, then refine it
- Add
"additionalProperties": falseto catch unexpected fields in API payloads - Use
"format": "email","date-time", or"uri"for semantic string validation - Use
$refto reuse schema definitions and avoid repetition - Draft-07 is the safest choice for maximum tool compatibility