JSON Schema Validator Online: The Complete Guide
How to write JSON Schemas, validate documents online, understand draft-07 keywords, and apply schema validation in API development and config management.
Last updated: May 4, 2026
What is JSON Schema?
JSON Schema is a vocabulary for describing the shape and constraints of JSON data. It is itself a JSON document that specifies: which fields are required, what types they must be, allowed value ranges, string patterns, and whether extra fields are permitted. A validator then checks whether a real JSON document (called the instance) conforms to the schema.
JSON Schema is widely used in API development (OpenAPI/Swagger schemas are built on it), form validation, configuration file validation, and database input sanitization. The current specification is at draft-07, which is the most widely supported version across libraries.
A minimal JSON Schema example
Schema
{
"type": "object",
"required": ["id", "email"],
"properties": {
"id": { "type": "integer", "minimum": 1 },
"email": { "type": "string", "pattern": ".+@.+" },
"age": { "type": "integer", "minimum": 0, "maximum": 150 }
},
"additionalProperties": false
}Valid document
{ "id": 1, "email": "alice@example.com", "age": 30 }Invalid document and errors
{ "id": 0, "extra": true }
$.id: value 0 is less than minimum 1
$.email: required property "email" is missing
$.extra: additional property "extra" is not allowedJSON Schema draft-07 keyword reference
| Keyword | Applies to | Effect |
|---|---|---|
| type | any | Constrain value to string, number, integer, boolean, object, array, or null |
| properties | object | Define schemas for named properties |
| required | object | List of property names that must be present |
| additionalProperties | object | false to reject extra fields; or a schema for them |
| items | array | Schema that all array elements must satisfy |
| minItems / maxItems | array | Minimum and maximum array length |
| uniqueItems | array | true to require all elements to be distinct |
| minLength / maxLength | string | Minimum and maximum string character length |
| pattern | string | Regular expression the string must match |
| minimum / maximum | number | Inclusive value bounds |
| exclusiveMinimum / exclusiveMaximum | number | Exclusive value bounds (boolean in draft-07) |
| multipleOf | number | Value must be divisible by this number |
| enum | any | Value must be one of the listed options |
| const | any | Value must equal this exact value |
| allOf | any | Value must satisfy all listed schemas |
| anyOf | any | Value must satisfy at least one listed schema |
| oneOf | any | Value must satisfy exactly one listed schema |
| not | any | Value must NOT satisfy the given schema |
4 use cases for JSON Schema validation
Validate that a real API response matches your expected OpenAPI schema. Catch breaking changes — removed required fields, changed types, new constraints — before they reach production.
Ship a JSON Schema alongside your application's config file format. Developers get immediate, precise error messages when they misconfigure a field, instead of cryptic runtime errors.
Use JSON Schema on the server to validate submitted form data. The same schema can drive both backend validation and frontend form generation with libraries like react-jsonschema-form.
Validate records entering a pipeline against a schema. Reject or quarantine records with missing required fields or out-of-range values before they propagate bad data downstream.
Schema composition with allOf, anyOf, oneOf
JSON Schema supports schema composition keywords that let you combine multiple schemas:
allOfThe instance must satisfy ALL listed schemas. Use it to extend a base schema without repeating its properties.
anyOfThe instance must satisfy AT LEAST ONE listed schema. Use it to accept values of multiple shapes — for example, either a string or an array of strings.
oneOfThe instance must satisfy EXACTLY ONE listed schema. Use it for mutually exclusive types where a value cannot belong to two categories simultaneously.
notThe instance must NOT satisfy the given schema. Use it to exclude specific values or patterns.
Frequently asked questions
Draft-2020-12 introduced several improvements: $defs replaces definitions, prefixItems for array tuple validation, unevaluatedProperties for stricter validation, and $dynamicRef for recursive schemas. Draft-07 remains the most widely supported version across libraries and tools.
Basic $ref support for same-document references is not included in the browser-based validator. For schemas that use $ref extensively, use a library like AJV in your application code.
By default, additional properties are allowed. Set additionalProperties: false to reject any property not listed in properties, or set it to a schema to validate all extra properties against that schema.
Yes. Use "type": "array" with "items" set to an object schema. Each element in the array will be validated against the items schema independently.
No. The validator runs entirely in your browser using JavaScript. Neither the schema nor the document is transmitted anywhere.