Validate any JSON document against a JSON Schema instantly. Paste your schema and your JSON data to check conformance, identify missing fields, and catch type errors. Free, no signup, supports draft-07 and later.
Open JSON Schema Validator →JSON Schema is a vocabulary for annotating and validating JSON documents. A schema is itself a JSON document that describes the expected structure of another JSON value. It specifies what properties an object must have, what data types are allowed, which fields are required, what patterns strings must match, and the valid ranges for numeric values.
A minimal JSON Schema looks like this:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": { "type": "integer" },
"name": { "type": "string", "minLength": 1 },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 0, "maximum": 150 },
"roles": { "type": "array", "items": { "type": "string" } }
},
"required": ["id", "name", "email"]
}
This schema requires a JSON object with integer id, non-empty string name, and valid email string. The age and roles fields are optional. Any JSON that violates these constraints will fail validation with a descriptive error message.
JSON Schema is used across the software industry for API contract validation, configuration file validation, database schema enforcement, form input validation, and automated testing pipelines.
JSON Schema has evolved through several specification drafts. Each version added new keywords and refined existing behavior. Here is an overview of the major versions:
| Version | $schema URI | Key Changes |
|---|---|---|
| Draft-04 | draft-04/schema | Introduced allOf, anyOf, oneOf, not |
| Draft-06 | draft-06/schema | Added const, contains, propertyNames, examples |
| Draft-07 | draft-07/schema | Added if/then/else, readOnly, writeOnly |
| 2019-09 | 2019-09/schema | Added $anchor, $recursiveRef, unevaluatedProperties |
| 2020-12 | 2020-12/schema | prefixItems for tuples, $dynamicRef, stable spec |
For maximum compatibility with existing tooling and libraries, draft-07 is the most widely supported version. For new projects, 2020-12 is the current recommended standard.
Specifies the allowed JSON type for a value. Valid types are string, number, integer, boolean, array, object, and null. You can pass an array of types to allow multiple: "type": ["string", "null"] accepts either a string or null.
An array of property names that must be present in the object. If any listed property is absent, validation fails. Note that required only checks for presence - it does not constrain the value. A property can be required but also have "type": "null", meaning it must be present but can be null.
Defines schemas for named properties of an object. Each key in properties is a property name and each value is a sub-schema that the corresponding value must satisfy. Properties not listed under properties are allowed by default (unless additionalProperties: false is set).
Constrains a string value to match a regular expression. For example, "pattern": "^[A-Z]{2}[0-9]{4}$" would accept "AB1234" but reject "ab1234" or "ABC123". The pattern is matched against the entire string using the ECMAScript regular expression dialect.
For numbers and integers, you can apply minimum, maximum, exclusiveMinimum, exclusiveMaximum, and multipleOf. For example, "minimum": 1, "maximum": 100, "multipleOf": 5 accepts 5, 10, 15... up to 100.
allOf requires the data to be valid against all listed sub-schemas (logical AND). anyOf requires validity against at least one (logical OR). oneOf requires validity against exactly one (exclusive OR). These keywords are powerful for modeling union types, inheritance, and polymorphic data structures.
REST APIs return JSON responses. Adding a JSON Schema to your API documentation (via OpenAPI / Swagger) lets clients and servers automatically validate request and response bodies against a contract. This catches integration bugs early and generates useful error messages when a client sends malformed data.
Application configuration files in JSON format can be validated against a schema at startup. If a required field is missing or a value has the wrong type, the application can emit a clear error message rather than failing silently at runtime hours later. VS Code uses JSON Schema to provide auto-complete and validation for tsconfig.json, package.json, and other config files.
ETL (extract-transform-load) pipelines that process JSON data can use schema validation as a quality gate. Records that fail validation can be routed to an error queue for manual review rather than silently corrupting the downstream database. This is a critical pattern in data engineering and event-driven architectures.
Libraries like ajv (JavaScript), jsonschema (Python), and everit-json-schema (Java) can run JSON Schema validation on user-submitted form data server-side, providing structured validation error messages that map directly back to the form fields that failed.
JSON Schema is a vocabulary for annotating and validating JSON documents. It is defined as a JSON document itself. A schema describes the expected structure of a JSON value: what properties it must have, what types those properties should be, which fields are required, what patterns strings must match, and more. JSON Schema is used for API contract validation, configuration file validation, and automated data quality checks.
Draft-07 (2018) is the most widely supported version across libraries and tools. Draft 2019-09 added anchors, $recursiveRef, and richer annotation support. Draft 2020-12 is the current stable specification and introduces prefixItems for array tuple validation, $dynamicRef replacing $recursiveRef, and other refinements. For maximum library compatibility, draft-07 is the safest choice. For new projects using modern validators like ajv 8+, 2020-12 is recommended.
Use the required keyword at the object level. It takes an array of property names that must be present. For example: {"type":"object","properties":{"name":{"type":"string"},"age":{"type":"integer"}},"required":["name"]}. This makes name required but leaves age optional. Omitting the required keyword entirely means all properties are optional.
Yes. Use "type": "array" with the items keyword to define the schema for each array element. For example: {"type":"array","items":{"type":"object","required":["id","name"]}} validates an array where every element must be an object with both id and name. Add minItems and maxItems to constrain the array length.
Free, instant, 100% private. No account needed.
Open JSON Schema Validator →Also useful: JWT Decoder | JSON Validator | JSON Formatter | JSONPath Evaluator | JSON Schema Tutorial | JSON to TypeScript