JSON Schema Validator Online

JSON Schema Validator
Validate JSON Instantly

Paste your JSON and a schema to validate it in real time. Reports all errors with the exact path where validation failed. Supports Draft-07 keywords including $ref, allOf, anyOf, and if/then/else.

Try Schema Validator
📋

Full Draft-07

Comprehensive Keywords — Supports type, properties, required, items, enum, const, allOf, anyOf, oneOf, not, and if/then/else.

$ref

$ref Support

Schema Composition — Reference and reuse schema definitions with $ref, $defs, and definitions.

Precise Errors

Exact Error Paths — Every error reports the full JSONPath where validation failed, making it easy to pinpoint issues.

Everything you need to validate JSON

type — Type Checking Validates string, number, integer, boolean, array, object, null, and union types.
properties / required — Object Validation Checks that required keys exist and each property matches its schema.
items — Array Validation Validates every element in an array against an item schema.
allOf / anyOf / oneOf — Composition Combine schemas with AND, OR, or exactly-one semantics.
if / then / else — Conditional Validation Apply schemas conditionally based on whether the data matches a predicate.
$ref — Schema Reuse Reference named schemas in $defs or definitions to avoid repetition.
enum / const — Exact Values Restrict values to a specific list or a single constant.
String / Number Constraints minLength, maxLength, pattern, minimum, maximum, exclusiveMinimum/Maximum, multipleOf.

Your data never leaves your device

No backend server — validation is pure JavaScript in your browser

  • Your JSON and schema never leave your device
  • No WebSocket, no fetch, no XHR for your JSON content
  • No account, no login, no cookies tied to you
  • Works fully offline after the initial page load

Related JSON tools

JSON Validator Validate JSON syntax against RFC 8259 with precise error locations.
JSONPath Evaluator Query and extract data from JSON with JSONPath expressions.
JSON Formatter Pretty-print JSON with syntax highlighting and a collapsible tree view.
JSON Repair Fix broken JSON: trailing commas, unquoted keys, single quotes, and more.

Common questions answered

What is JSON Schema?

JSON Schema is a vocabulary for annotating and validating JSON documents. It lets you define the expected structure, types, and constraints of your JSON data.

Is this JSON Schema validator free?

Yes, completely free with no account required.

Does the validator send my data to a server?

No. All validation runs locally in your browser — your JSON and schema never leave your device.

Which JSON Schema draft is supported?

The validator supports most Draft-07 keywords: type, properties, required, items, additionalItems, allOf, anyOf, oneOf, not, if/then/else, $ref, enum, const, minLength, maxLength, pattern, minimum, maximum, multipleOf, minItems, maxItems, and uniqueItems.

What does $ref do in JSON Schema?

$ref lets you reference a schema definition elsewhere in the same document, via the #/$defs/ or #/definitions/ path. This allows schemas to be reused and composed.

What is JSON Schema validation?

JSON Schema is a vocabulary for annotating and validating the structure of JSON data. A schema defines expected types, required fields, string patterns, number ranges, and nested object shapes. Validating data against a schema catches structural errors before they reach application logic — a practice widely used in API design, form validation, and data pipeline contracts.

This tool supports JSON Schema Draft 4, 6, 7, and 2020-12. Paste your data in one panel and your schema in the other to get instant validation results. Errors include the JSON path to the failing field, the expected type or constraint, and the actual value found. You can also generate a schema from sample data to bootstrap your validation rules.

Validate data against a schema
Input
// Schema
{"type":"object",
 "required":["name","age"],
 "properties":{
  "name":{"type":"string"},
  "age":{"type":"number",
    "minimum":0}}}

// Data
{"name":"Alice","age":-5}
Output
✗ Validation error:
  Path: /age
  Expected: minimum 0
  Actual: -5

  1 error found.

Get the most out of this tool

Ready to validate your JSON Schema?

Free forever. No signup. Works offline.

Open Schema Validator

Understanding JSON Schema validation

JSON Schema is a vocabulary for annotating and validating JSON documents. While the plain JSON validator checks only syntax (is this valid JSON?), a JSON Schema validator checks semantics (does this JSON data conform to a defined structure?). You can specify that a field must be a string, that a number must be between 1 and 100, that an array must contain at least three elements, and that an object must have certain required properties. JSON Schema brings contract-level validation to JSON APIs.

The JSON Schema specification is maintained by the JSON Schema organization at json-schema.org, currently at Draft 2020-12 (also written as Draft 12). Earlier widely-used versions include Draft 7 and Draft 4. The drafts are additive — newer versions add new keywords and fix ambiguities. Most tooling supports Draft 7 as the lowest common denominator, while Draft 2020-12 adds powerful features like $dynamicRef for recursive schemas and prefixItems for tuple validation.

Core schema keywords include type, which specifies what JSON type a value must be (string, number, integer, boolean, array, object, null). The enum keyword restricts a value to a specific set of allowed values. The const keyword requires an exact match. The required keyword in an object schema lists properties that must be present. The properties keyword defines the schema for each named property. The additionalProperties keyword controls whether properties not listed in properties are allowed.

String validation uses keywords like minLength, maxLength, and pattern (a regular expression the string must match). The format keyword provides semantic validation for common string formats: email addresses (format: email), URLs (format: uri), date strings (format: date), and date-time strings (format: date-time). Note that format validation is optional in the specification — validators may choose to ignore it unless configured to enforce it.

Combining schemas with allOf, anyOf, oneOf, and not enables complex validation logic. allOf requires all sub-schemas to match. anyOf requires at least one to match. oneOf requires exactly one to match. not inverts a schema. These combiners let you express rules like "must be a string or null", "must match one of these three specific schemas", or "must not be an empty string" — patterns that appear constantly in real-world API contracts.

JSON Schema is the foundation of OpenAPI specifications. Every request body, response body, and query parameter in an OpenAPI 3.0 document is described using a JSON Schema subset. Swagger UI, Redoc, and other API documentation tools use these schemas to generate interactive documentation and request/response examples. Validating your actual API data against the OpenAPI-embedded JSON Schema is how you verify the implementation matches the contract.

Schema generation from data is the reverse operation: given a JSON document, infer a schema that describes its structure. This tool supports schema generation in addition to validation — paste a JSON example and the schema generator produces a Draft 7 schema with types, required fields, and basic constraints. It is a fast starting point for schema-first API development, especially when you have existing data samples but no formal specification yet.

When developers use this tool

API contract testing Validate that API responses conform to the documented JSON Schema contract. When the schema and response disagree, you have found either a documentation error or an implementation bug.
Form input validation Web applications collecting complex structured data (multi-step forms, JSON configuration editors) use JSON Schema to validate user input server-side before processing or storing it.
Event schema governance Event-driven systems publish messages to message brokers. Validating each event against a registered JSON Schema before publishing prevents schema drift and ensures consumers always receive expected data shapes.
Configuration validation Application configuration files in JSON can be validated against a schema at startup. If the config is invalid, the app refuses to start with a clear error — better than cryptic runtime failures later.

Additional frequently asked questions

Which JSON Schema draft does this tool support?

This tool supports JSON Schema Draft 7, which is the most widely deployed version and the default in tools like Ajv, jsonschema (Python), and Visual Studio Code's built-in JSON Schema support. Draft 2020-12 added new features like unevaluatedProperties and $dynamicRef that are not yet universally supported.

What is the difference between additionalProperties: false and not allowing extra fields?

Setting additionalProperties: false in a JSON Schema causes validation to fail if the JSON object contains any property not explicitly listed in the properties or patternProperties keywords. This is the strictest form of object validation. Without this keyword, extra fields are silently allowed — which is the more lenient default behavior.

Can I use $ref to reference external schemas?

The $ref keyword is supported for in-document references (using JSON Pointer notation like #/definitions/Address). External URL references require the validator to fetch the referenced schema, which this browser-based tool handles for same-origin URLs. For cross-origin references, host your schemas with appropriate CORS headers.

How do I validate that a field is either a string or null?

Use the type keyword with an array: {"type": ["string", "null"]}. In JSON Schema Draft 7 and earlier, you can also use {"anyOf": [{"type": "string"}, {"type": "null"}]}. In OpenAPI 3.0, you use nullable: true alongside the type. In OpenAPI 3.1 (which uses JSON Schema 2020-12), type: ["string", "null"] works directly.