Validate a JSON document against a JSON Schema. Catches type mismatches, missing required fields, out-of-range values, regex failures, and constraint violations. Essential for API contract testing and config validation.
Paste a schema and document, then click Validate
JSON Schema is a vocabulary for describing the structure of JSON data. Think of it as a type system for JSON: a way to specify what fields a JSON document should have, what types those fields should be, what values are allowed, and how fields relate to each other. A JSON Schema is itself a JSON document — so it can be transmitted, stored, and version-controlled like any other data.
Schemas matter because JSON itself is dynamically typed. Without a schema, your code has to guess what shape a JSON document will have. With a schema, you can validate inputs before processing, generate type definitions automatically, document APIs precisely, and even generate test fixtures or mock data.
JSON Schema is the most widely used schema vocabulary for JSON. OpenAPI uses it for request and response definitions. AsyncAPI uses it for event payloads. AJV (the most popular JSON Schema library) ships in npm 50+ million times per week. If you work with JSON APIs at any scale, you'll encounter JSON Schema.
You provide two things: a schema (the rules) and a document (the data to validate). The validator checks the document against every rule in the schema and reports either "valid" or a list of every rule that failed.
Example schema:
{
"type": "object",
"required": ["id", "name", "email"],
"properties": {
"id": { "type": "integer", "minimum": 1 },
"name": { "type": "string", "minLength": 1 },
"email": { "type": "string", "format": "email" },
"age": { "type": "integer", "minimum": 0, "maximum": 150 }
},
"additionalProperties": false
}
This schema requires an object with three mandatory fields, type-checks each one, validates the email format, constrains the age range, and forbids any other fields. A document that omits "email" would produce an error like "Missing required property: email". A document with an extra field would produce "Additional property X not allowed".
Our validator supports the practical subset of JSON Schema used in 95%+ of real-world schemas:
type with string, number, integer, boolean, null, array, object — or arrays of types for unions.
required list, additionalProperties: false for closed schemas, minProperties and maxProperties.
minLength, maxLength, pattern (regex), format (email, uri, uuid, date, date-time, ipv4).
minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf.
items (single schema or tuple), minItems, maxItems, uniqueItems.
enum (list of allowed values), const (must equal this value).
allOf, anyOf, oneOf — match all, any, or exactly one subschema.
$ref resolving to #/definitions/X within the same schema. (External URLs not fetched.)
$ref URLs?#/definitions/X within the same schema document. Fetching external schemas would require network requests, which contradicts our privacy-first design. For external refs, inline them first (using json-dereference-cli or similar).components.schemas or inline under requestBody.content.application/json.schema) and paste it here along with the request or response body.quicktype (online and CLI) infer schemas from sample JSON. The inferred schema is a starting point — you'll usually want to tighten constraints (required fields, value ranges, regex patterns) by hand.