Code & Data Formatters

Free Online JSON Schema Validator

Check JSON against a JSON Schema in seconds. Paste your schema and payload to validate types, required fields, enums, nested objects and arrays, and get each error with its exact path — a free schema validator that never uploads your data.

Loading Utility…

JSON Schema Validator Online

JSON Schema is a vocabulary for describing the structure of JSON documents. A schema specifies the expected type of each property (string, number, boolean, object, array), which fields are required, allowed enum values, minimum/maximum constraints, and string format rules like "email" or "date-time". Validation checks that an actual JSON document satisfies every rule in the schema and returns the exact JSON path for each violation — so instead of a vague parse error, you know immediately that "/user/email is not a valid email" or "/items/0/price must be >= 0". JSON Schema is the backbone of OpenAPI specifications, configuration file validation in tools like Ajv and jsonschema, and request/response contract testing in API-driven development.

How to Validate JSON Schema Online

Paste your JSON Schema definition into the Schema panel and your JSON payload into the JSON panel. The validator runs instantly in your browser as you type — no server upload, no latency. Each error is listed with the full property path (e.g., "/data/items/2/price"), the failed rule (type, required, minimum, pattern), and the expected vs. actual value. You can validate draft-07 schemas including if/then/else conditionals, $ref references to reusable sub-schemas, and additionalProperties constraints. All processing happens locally so you can safely validate schemas containing sensitive data like PII or authentication payloads.

Supported JSON Schema Keywords

The validator supports the full JSON Schema draft-07 keyword set: type, properties, required, additionalProperties, patternProperties, items, prefixItems, minItems, maxItems, uniqueItems, minimum, maximum, exclusiveMinimum, exclusiveMaximum, minLength, maxLength, pattern, format (email, uri, date-time, uuid), enum, const, anyOf, oneOf, allOf, not, if/then/else, and $ref for schema composition. The format keyword validates string formats beyond basic type checking — useful for validating email addresses, ISO 8601 dates, and URIs in API request bodies before they reach your backend.

Common JSON Schema Validation Errors

The most frequent validation errors are: "required property missing" (a field listed in the required array is absent from the JSON), "type mismatch" (a string value where a number was expected, or an object where an array is required), "additionalProperties not allowed" (the JSON includes a field not defined in properties when additionalProperties is false), "pattern does not match" (a string fails a regex constraint), and "minimum/maximum violated" (a number is outside the allowed range). Error paths use JSON Pointer notation — "/user/address/zip" means the "zip" field inside the "address" object inside "user" — making it easy to locate the failing field in large payloads.

JSON Schema Validator Guide · 9 min read

Free JSON Schema Validator Online — Validate JSON Against Schema Instantly

A syntactically valid JSON payload can still violate your API contract — missing required fields, wrong types, out-of-range values, enum mismatches. Our free JSON Schema Validator online checks any JSON payload against a JSON Schema definition and returns field-level errors with the exact path to every violation, entirely in your browser. No libraries to install, no test code to write — paste your schema and payload, get an instant pass/fail with actionable error messages.

How to Validate JSON Against a Schema Online

Validating a JSON payload against a schema online takes three steps with our tool:

  1. Paste your JSON Schema into the left panel — this is the schema definition that describes what valid data looks like. If you don't have one yet, use the example schema in the tool as a starting point.
  2. Paste your JSON payload into the right panel — the actual data you want to validate, such as an API request body, a webhook payload, or a config file.
  3. Read the validation result — a green "Valid" means the payload satisfies every rule in the schema. A red "Invalid" lists every violation with the exact field path (e.g. $.user.email: must be a valid email address) so you can fix each one directly.

The validator supports JSON Schema Draft 7 (the most widely deployed version), Draft 2019-09, and Draft 2020-12. It auto-detects the draft from the $schema declaration in your schema, or defaults to Draft 7 if none is present.

Common situations where you'd validate JSON against a schema online:

  • Testing an API request body before writing integration tests
  • Debugging a third-party webhook payload that's failing your validation middleware
  • Verifying a generated config file matches your expected structure
  • Checking a data export from a database before importing it into another system

Why JSON Schema Validation Is Different from Formatting

Formatting a JSON document — adding indentation, checking for syntax errors — validates that the text is parseable. It tells you nothing about whether the parsed data is correct.

These are two separate problems:

Check What it catches
Syntax validation (formatter) Missing commas, unquoted keys, mismatched brackets
Schema validation Wrong types, missing required fields, out-of-range values, invalid enum values

A payload can be perfectly formatted and still be semantically wrong:

{
  "userId": null,
  "amount": "49.99",
  "status": "pending_approval"
}

This is valid JSON. But if your schema says userId is required and non-null, amount must be a number, and status must be one of ["pending", "complete", "failed"] — this payload fails validation on all three counts. Schema validation catches these before the data reaches your application code.

JSON Schema Basics

A JSON Schema is itself a JSON document that describes the shape of valid data:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "required": ["id", "email", "role"],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "User's unique identifier"
    },
    "email": {
      "type": "string",
      "format": "email",
      "maxLength": 254
    },
    "role": {
      "type": "string",
      "enum": ["admin", "editor", "viewer"]
    },
    "age": {
      "type": "integer",
      "minimum": 18,
      "maximum": 120
    },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "uniqueItems": true
    }
  },
  "additionalProperties": false
}

This schema enforces: id, email, and role are required; age if present must be 18–120; tags must be an array of unique strings; no extra properties are allowed.

Type Keywords

{ "type": "string" }     // "hello", "123", ""
{ "type": "number" }     // 42, 3.14, -7
{ "type": "integer" }    // 42, -7 (not 3.14)
{ "type": "boolean" }    // true, false
{ "type": "null" }       // null
{ "type": "array" }      // [], [1, 2, 3]
{ "type": "object" }     // {}, {"key": "value"}

// Multiple types (nullable field)
{ "type": ["string", "null"] }

String Constraints

{
  "type": "string",
  "minLength": 1,
  "maxLength": 100,
  "pattern": "^[a-zA-Z0-9_-]+$",
  "format": "email"
}

Built-in format keywords (enforcement depends on the validator):

  • "email" — valid email address
  • "date" — YYYY-MM-DD
  • "date-time" — ISO 8601 datetime
  • "uri" — valid URI
  • "uuid" — UUID v4 format
  • "ipv4" / "ipv6" — IP address

For pattern validation, test your regex with our Regex Tester before embedding it in a schema — a broken pattern silently passes everything.

Number Constraints

{
  "type": "number",
  "minimum": 0,
  "maximum": 1000000,
  "exclusiveMinimum": 0,
  "multipleOf": 0.01
}

exclusiveMinimum: 0 means the value must be > 0 (not >= 0). multipleOf: 0.01 enforces exactly 2 decimal places — useful for currency amounts.

Nested Objects and $ref

For complex schemas, define reusable components with $ref:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "address": {
      "type": "object",
      "required": ["street", "city", "country"],
      "properties": {
        "street": { "type": "string" },
        "city": { "type": "string" },
        "country": { "type": "string", "minLength": 2, "maxLength": 2 }
      }
    }
  },
  "type": "object",
  "properties": {
    "billing": { "$ref": "#/definitions/address" },
    "shipping": { "$ref": "#/definitions/address" }
  }
}

This defines address once and references it for both billing and shipping — keeping the schema DRY and maintainable.

Array Validation

{
  "type": "array",
  "minItems": 1,
  "maxItems": 100,
  "uniqueItems": true,
  "items": {
    "type": "object",
    "required": ["id", "quantity"],
    "properties": {
      "id": { "type": "string" },
      "quantity": { "type": "integer", "minimum": 1 }
    }
  }
}

uniqueItems: true enforces that no two array elements are identical — useful for tag lists, permission arrays, and ID collections.

Conditional Validation (if/then/else)

JSON Schema Draft 7+ supports conditional validation:

{
  "if": {
    "properties": { "type": { "const": "business" } }
  },
  "then": {
    "required": ["companyName", "taxId"]
  },
  "else": {
    "required": ["firstName", "lastName"]
  }
}

If type is "business", then companyName and taxId are required. Otherwise, firstName and lastName are required. This avoids having to define separate schemas for each entity type.

Schema Versions

Version $schema URI Notes
Draft 7 http://json-schema.org/draft-07/schema# Most widely supported
Draft 2019-09 https://json-schema.org/draft/2019-09/schema Added unevaluatedProperties
Draft 2020-12 https://json-schema.org/draft/2020-12/schema Latest, best conditional support

Our validator supports all major drafts. Always include the $schema declaration so validators know which version to apply.

Path-Level Error Reporting

Generic error messages ("validation failed") slow debugging. Good validation tools report errors with the exact path to the failing field:

$.user.billing.country: must be at most 2 characters long (got "United States")
$.items[2].quantity: must be a positive integer (got -1)
$.status: must be one of "pending", "complete", "failed" (got "pending_approval")

The path ($.user.billing.country) lets you navigate directly to the problem without scanning the entire payload. This is what makes field-level schema validation dramatically faster than debugging runtime type errors.

Workflow: Format → Validate → Test

  1. Format the raw JSON payload with our JSON Formatter — fix syntax errors and make it readable
  2. Validate against your schema here — catch type mismatches, missing fields, and constraint violations
  3. Test field patterns with our Regex Tester if schema pattern constraints need verification
  4. Submit via cURL Generator and verify the response

This four-step flow catches errors at the cheapest possible point — before any network request, code execution, or database write.

Before sharing failing payloads in bug reports, sanitize them with our PII Redactor to remove production user data while preserving the structural information needed for debugging.

Schema validation is the executable specification of your API contract. Validate JSON against schema before any network request, write schemas first, generate documentation from them, and catch type mismatches and missing fields at the cheapest possible point — before they hit production.

Frequently Asked Questions

Everything you need to know about the JSON Schema Validator and how your data is handled.

How do I check JSON against a schema online?
Paste your JSON Schema into the schema panel and your JSON document into the data panel. The validator checks the document immediately and lists every error with the JSON path of the failing field and the rule it broke.
What is JSON Schema and what can it validate?
JSON Schema is a vocabulary for annotating and validating JSON documents. A schema defines the expected structure of a JSON payload: the type of each property (string, number, boolean, array, object, null), required vs optional fields, string format constraints (email, uri, date-time), minimum and maximum values, array item types and length limits, and allowed enum values. The validator checks that an actual JSON document conforms to all rules in the schema and reports each violation with the exact JSON path where it occurred.
What is the difference between JSON Schema draft-07 and newer drafts?
JSON Schema draft-07 (2018) added if/then/else conditional validation, readOnly/writeOnly annotations, and the format keyword for validation. Draft-2019-09 added unevaluatedProperties, unevaluatedItems, $anchor, and $recursiveRef. Draft-2020-12 renamed $recursiveRef to $dynamicRef and made prefixItems the preferred way to validate tuple arrays. Draft-07 is the most widely supported draft in tools and frameworks (Ajv, jsonschema, Pydantic). This validator targets draft-07 for maximum compatibility.
How do I write a JSON Schema for an API request body?
A basic schema for a user registration object: {"type": "object", "required": ["email", "name"], "properties": {"email": {"type": "string", "format": "email"}, "name": {"type": "string", "minLength": 1, "maxLength": 100}, "age": {"type": "integer", "minimum": 0, "maximum": 150}}, "additionalProperties": false}. The required array lists mandatory fields. properties defines each field's type and constraints. additionalProperties: false rejects any fields not defined in the schema — useful for strict API validation.
Can JSON Schema validate nested objects and arrays?
Yes. Nested objects are validated by using "type": "object" with a nested properties definition for each level. Arrays are validated with "type": "array" plus an items schema that applies to every element (or a prefixItems array for tuple validation where each position has a different schema). You can also use minItems and maxItems to constrain array length. JSON Schema supports arbitrarily deep nesting and can reference reusable sub-schemas using $ref to avoid repetition in complex schemas.
How do I validate JSON against a schema online?
Paste your JSON Schema into the schema panel and your JSON payload into the data panel. The validator checks every field and returns either a green 'Valid' result or a list of field-level errors with exact paths like $.user.email showing where each violation occurs — missing required fields, wrong types, out-of-range values, and enum mismatches are all reported. No libraries to install, no test code to write.
What is the difference between JSON validation and JSON Schema validation?
JSON validation (formatting) checks that the text is parseable — correct syntax, no missing brackets or commas, no unquoted keys. JSON Schema validation checks that the data is semantically correct — the right types, all required fields present, values within allowed ranges, and enum constraints respected. A payload can be perfectly valid JSON syntax but still fail schema validation because a field has the wrong type or is missing.
Which JSON Schema draft should I use?
Draft 7 is the safest default — it is the most widely supported version across validators, frameworks, and OpenAPI tooling. Draft 2019-09 adds unevaluatedProperties and anchor support. Draft 2020-12 is the latest with improved conditional validation. Always include the $schema declaration in your schema document so validators know which version's rules to apply.
What does a JSON Schema validation error path mean?
The error path like $.items[2].quantity points to the exact location in your JSON payload where validation failed. The $ represents the root of the document, dot notation navigates into object properties, and bracket notation indexes into arrays. So $.items[2].quantity means the quantity field of the third item in the items array — navigate directly there to fix the violation.

Common Use Cases

  • API Contract Testing
  • Request Payload Validation
  • Integration QA

Related Tools