📋 JSON Schema Validator

Validate JSON against a JSON Schema or generate a schema from sample JSON.

JSON Input
JSON Schema
Validation Result

What Is JSON Schema?

JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. It defines the expected structure, data types, required fields, value constraints, and relationships within a JSON document. Think of it as a contract or blueprint that describes what valid JSON data should look like.

JSON Schema is defined in a series of IETF Internet-Drafts and is widely used in API design (OpenAPI/Swagger), configuration validation, form generation, and data pipeline quality assurance.

Key JSON Schema Keywords

KeywordPurposeExample
typeDefines the expected data type"type": "string"
propertiesDefines the expected object properties"properties": { "name": { "type": "string" } }
requiredLists mandatory fields"required": ["name", "email"]
minimum / maximumNumeric range constraints"minimum": 0, "maximum": 100
minLength / maxLengthString length constraints"minLength": 1, "maxLength": 255
patternRegex pattern for string validation"pattern": "^[A-Z]{2}$"
enumList of allowed values"enum": ["active", "inactive"]
itemsSchema for array elements"items": { "type": "string" }

Common Use Cases

  • API Validation: Validate request and response bodies against schemas defined in OpenAPI/Swagger specifications.
  • Configuration Files: Ensure application configs meet expected structure before deployment.
  • Form Generation: Automatically generate HTML forms from JSON Schema definitions.
  • Data Pipeline QA: Validate incoming data quality in ETL pipelines before processing.
  • Documentation: JSON Schemas serve as self-documenting contracts for data structures.

How to Use This Tool

  1. Paste your JSON data in the left panel.
  2. Paste your JSON Schema in the right panel.
  3. Click Validate to check compliance.
  4. Review detailed error messages for any validation failures.

Why Use This Tool?

  • Validate API payloads against JSON Schema before deployment.
  • Catch data structure issues early in development.
  • Detailed error messages pinpoint exactly what is wrong.
  • Supports JSON Schema Draft 4, 6, 7, and 2020-12.

Frequently Asked Questions

Which JSON Schema version should I use?

Draft 2020-12 is the latest version and recommended for new projects. Draft-07 is still widely supported and used by many tools and libraries.

Can JSON Schema validate nested objects?

Yes. JSON Schema supports deeply nested validation through properties containing sub-schemas, $ref for reusable definitions, and items for array elements.