🌙 Night Mode
Home β€Ί JSON Schema Validator
πŸ›‘οΈ Free Tool

JSON Schema Validator

Validate your JSON data against a JSON Schema blueprint. Get instant, detailed error messages with exact field paths β€” perfect for API development and data contracts.

JSON Data
Characters0
Statusβ€”
JSON Schema
Draft:
Characters0
Statusβ€”
πŸ›‘οΈ Paste your JSON and Schema above, then click Validate
Validation results will appear here.
πŸ›‘οΈ
Powered by Ajv
Uses Ajv β€” the industry-standard JSON Schema validator, supporting Draft-07, Draft 2019-09, and Draft 2020-12.
πŸ“
Exact Error Paths
Every error shows the precise JSON path (e.g. /user/email) so you know exactly which field failed.
⚑
Generate Schema
Paste your JSON data and click "Generate from Data" to auto-create a starting schema you can refine.

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 prefixItems for arrays

Common JSON Schema Keywords

Keyword Purpose Example
typeData type constraint"type": "string"
requiredMandatory keys on an object"required": ["id","name"]
propertiesObject property definitions"properties": {"id": {"type":"integer"}}
minimum / maximumNumeric range"minimum": 0, "maximum": 100
minLength / maxLengthString length"minLength": 3, "maxLength": 50
patternRegex pattern for strings"pattern": "^[A-Z]{2}\\d{6}$"
formatSemantic format (email, date, uri…)"format": "email"
enumAllowed values list"enum": ["active","inactive","pending"]
additionalPropertiesAllow/block extra keys"additionalProperties": false
itemsArray 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": false to catch unexpected fields in API payloads
  • Use "format": "email", "date-time", or "uri" for semantic string validation
  • Use $ref to reuse schema definitions and avoid repetition
  • Draft-07 is the safest choice for maximum tool compatibility