Guides · JSON

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 allowed

JSON Schema draft-07 keyword reference

KeywordApplies toEffect
typeanyConstrain value to string, number, integer, boolean, object, array, or null
propertiesobjectDefine schemas for named properties
requiredobjectList of property names that must be present
additionalPropertiesobjectfalse to reject extra fields; or a schema for them
itemsarraySchema that all array elements must satisfy
minItems / maxItemsarrayMinimum and maximum array length
uniqueItemsarraytrue to require all elements to be distinct
minLength / maxLengthstringMinimum and maximum string character length
patternstringRegular expression the string must match
minimum / maximumnumberInclusive value bounds
exclusiveMinimum / exclusiveMaximumnumberExclusive value bounds (boolean in draft-07)
multipleOfnumberValue must be divisible by this number
enumanyValue must be one of the listed options
constanyValue must equal this exact value
allOfanyValue must satisfy all listed schemas
anyOfanyValue must satisfy at least one listed schema
oneOfanyValue must satisfy exactly one listed schema
notanyValue must NOT satisfy the given schema

4 use cases for JSON Schema validation

API contract testing

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.

Configuration file validation

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.

Form input validation

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.

Data pipeline quality gates

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:

allOf

The instance must satisfy ALL listed schemas. Use it to extend a base schema without repeating its properties.

anyOf

The 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.

oneOf

The instance must satisfy EXACTLY ONE listed schema. Use it for mutually exclusive types where a value cannot belong to two categories simultaneously.

not

The instance must NOT satisfy the given schema. Use it to exclude specific values or patterns.

Frequently asked questions

What is the difference between JSON Schema draft-07 and draft-2020-12?

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.

Does the validator support $ref?

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.

What happens if additionalProperties is not set?

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.

Can I validate arrays of objects with JSON 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.

Is my schema or JSON document sent to a server?

No. The validator runs entirely in your browser using JavaScript. Neither the schema nor the document is transmitted anywhere.