Skip to main content

JSON Schema: A Language for Validating and Annotating JSON

JSON Schema is a domain-specific, declarative language for validating and annotating JSON documents. It provides a standardized way to define the structure, constraints, and metadata associated with JSON-based APIs and data formats, facilitating automated validation, documentation, and related tooling.
JSON is excellent for data exchange, but lacks a native mechanism for formally describing its structure and constraints. JSON Schema fills this gap, reducing ambiguity and errors in data interchange.

Why JSON Schema?

JSON Schema draws inspiration from the architecture of the World Wide Web, including concepts such as URIs for identifying and linking schemas. While it can be applied in many domains, these qualities make it especially well-suited for describing and validating data exchanged in web APIs.

Validation

Ensure that JSON instances conform to a specific structure and set of constraints. Catch data errors before they cause problems.

Annotation

Attach metadata to values in JSON documents, which can be used by applications for documentation, form generation, and more.

Documentation

Schemas serve as living documentation that describes your data structures in a machine-readable format.

Interoperability

Create a contract for data exchange between systems, ensuring compatibility across different implementations.

Key Features

Self-Describing

A JSON Schema is itself a JSON document, making it easily portable and machine-readable. You can validate schemas, share them across systems, and even generate schemas programmatically.

Extensible

JSON Schema includes a flexible extension model that allows third parties to define their own dialects and vocabularies for specific use cases.

Standards-Based

JSON Schema is defined through IETF Internet-Drafts and maintained by an active open-source community, ensuring stability and broad industry support.

Core Concepts

What is JSON Schema?

Learn about the fundamentals, terminology, and use cases for JSON Schema.

Getting Started

Write your first schema with a practical example that validates JSON data.

A Schema as a Contract

A JSON Schema serves as a contract for data. It is primarily designed for two purposes:
  1. Validation - Ensures that a JSON instance conforms to a specific structure and set of constraints
  2. Annotation - Attaches metadata to values in a JSON document, which can be used by applications in a variety of ways
JSON Schema can also be used for documentation generation, HTML form builders, and type code generation. Although it is not specifically designed for those tasks, JSON Schema can be extended to fill any gaps required to support these secondary uses.

Specification Structure

The JSON Schema specification is defined in a series of documents, each addressing a different aspect of the language:
  • Core Specification - Defines fundamental keywords and concepts ($schema, $id, $ref, $defs, etc.)
  • Validation Specification - Defines keywords for structural validation (type, properties, required, pattern, etc.)
  • Additional vocabularies - Define specialized keywords for specific use cases
This documentation is based on the v1/2026 specification. Implementations may continue to support earlier “draft” releases for backward compatibility.

Community and Support

Specification

Read the official IETF specification documents

GitHub

Contribute to the specification and report issues

Website

Explore tools, implementations, and community resources

Next Steps

1

Understand the Basics

Read What is JSON Schema? to learn about instances, schemas, and validation concepts.
2

Write Your First Schema

Follow the Getting Started guide to create a working schema example.
3

Explore Advanced Features

Learn about schema composition, references, and advanced validation patterns.

Build docs developers (and LLMs) love