JSON Schema Validator
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
What is JSON Schema?
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.
How JSON Schema validation works
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".
Schema features supported
This validator implements draft-07 and 2020-12 in full, and is tested against the
official JSON Schema Test Suite
— 904/906 draft-07 assertions and 1221/1226 for 2020-12. The handful it does not pass are cases requiring
network access or $dynamicRef; in those cases it reports an error rather than declaring your document valid.
Anything it cannot enforce is shown as a warning, so valid never means partly checked.
T Type validation
type with string, number, integer, boolean, null, array, object — or arrays of types for unions.
R Required & optional
required list, additionalProperties: false for closed schemas, minProperties and maxProperties.
S String constraints
minLength, maxLength, pattern (regex), format (email, uri, uuid, date, date-time, ipv4).
N Number constraints
minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf.
A Array constraints
prefixItems + items (2020-12), items + additionalItems (draft-07), contains, minContains, maxContains, minItems, maxItems, uniqueItems.
? Conditionals
if / then / else and not, so schemas that change shape based on a discriminator field are checked properly.
P Property matching
patternProperties, propertyNames, and additionalProperties as a schema — not just false.
D Dependencies
dependentRequired and dependentSchemas (2020-12), dependencies (draft-07).
U Unevaluated
unevaluatedProperties and unevaluatedItems, with annotations collected across allOf, anyOf, $ref and if/then.
E Enums & consts
enum (list of allowed values), const (must equal this value).
∪ Composition
allOf, anyOf, oneOf — match all, any, or exactly one subschema.
$ References
$ref to #, #/$defs/X, #/definitions/X, $anchor, and $id-relative URIs inside the pasted schema. Escaped pointers (~0, ~1) resolve correctly, and circular refs are caught instead of hanging the tab.
! What it will not do
External $ref URLs are never fetched (everything runs in your browser), and $dynamicRef is not implemented. Both are reported as errors, never passed over. format is an assertion here by default — toggle it off for spec-strict annotation behaviour.
FAQ — Json Schema Validator
$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.Everything on this page runs in your browser — no upload, no server-side processing. How it works →
Generate one from your data
The schema generator infers a draft-07 or 2020-12 schema from a set of samples, then validates it here.