JSON Schema Validator

Validate JSON data against a JSON Schema. Runs entirely in your browser.

JSON Data
JSON Schema
Validation Result

Paste JSON data and a schema

Validation runs automatically as you type

Paste data and schema to validateDraft-07 → 2020-12 keywords, incl. $ref · browser only

What is JSON Schema?

JSON Schema is a vocabulary that allows you to annotate and validate JSON documents. You define the expected structure — required fields, allowed types, string formats, numeric ranges — and a validator checks whether your data conforms to it. It's widely used for API request/response validation, webhook payload checks, config file validation, and as the schema layer inside OpenAPI.

How to Validate JSON Against a Schema

  1. 1Paste your JSON data into the left panel
  2. 2Paste your JSON Schema into the right panel
  3. 3The validator runs automatically and shows results below
  4. 4Fix any highlighted errors and re-validate in real time
  5. 5Click Share to copy a link that reproduces both panels for a teammate

Example

JSON Schema:

{
  "type": "object",
  "required": ["name", "age"],
  "properties": {
    "name":  { "type": "string", "minLength": 1 },
    "age":   { "type": "number", "minimum": 0 },
    "email": { "type": "string", "format": "email" }
  },
  "additionalProperties": false
}

Valid JSON data:

{ "name": "Ravi", "age": 28, "email": "ravi@example.com" }

Invalid JSON data (age is a string, unknown field present):

{ "name": "Ravi", "age": "twenty-eight", "role": "admin" }

Where JSON Schema Validation Helps

  • API contract testingValidate real request/response bodies against your OpenAPI-derived schema in CI, so a breaking change to a payload shape fails the build instead of a customer's integration.
  • Webhook payload checksReject malformed webhooks (Stripe, GitHub, custom integrations) before they reach business logic, with a precise error pointing at the offending field.
  • Config file validationCatch a typo'd key or wrong type in a JSON config file at deploy time instead of a runtime crash in production.
  • Reviewing an unfamiliar schemaPaste a schema you inherited alongside a real sample payload to confirm you understand exactly what it does and doesn't enforce.
  • Debugging a validation libraryReproduce a confusing Ajv/jsonschema error in an isolated, shareable link before you dig into the library's own error output.
  • Learning $ref-based compositionPaste a schema that uses $defs and $ref for shared types (Address, Money, User) and see exactly how the referenced shape gets enforced.

Supported Keywords

type

string, number, integer, boolean, array, object, null — including union arrays

required / properties

Required field names and per-property schemas

additionalProperties

Reject (false) or allow extra fields beyond properties

minProperties / maxProperties

Bound the number of keys on an object

minLength / maxLength / pattern

String length and regex constraints

format

email, uri, date, date-time, ipv4, uuid

minimum / maximum

Inclusive numeric bounds

exclusiveMinimum / exclusiveMaximum

Strict (non-inclusive) numeric bounds

multipleOf

Require the number to be an exact multiple

items / minItems / maxItems / uniqueItems

Array element schema, length bounds, duplicate detection

enum / const

Restrict value to a specific set or single value

allOf / anyOf / oneOf / not

Schema composition, union types and negation

if / then / else

Conditional schema application

$ref / $defs

Internal references like #/$defs/Address for reusable sub-schemas

Understanding Common Validation Errors

Error keywordWhat it meansTypical fix
typeThe value's JSON type doesn't match what the schema declaresCheck for a string where a number (or vice versa) was expected — a very common API bug
requiredA property the schema demands is missing from the objectAdd the field, or remove it from required if it's genuinely optional
additionalPropertiesThe data has a key the schema doesn't declare in propertiesFix a typo'd key name, or add the field to properties if it's intentional
patternA string doesn't match the required regexCompare the value against the pattern in the Regex Tester to see exactly where it diverges
formatA string fails a semantic format check (email, uuid, date…)Confirm the value is actually well-formed — not just any string
oneOfThe value matched zero, or more than one, of the listed sub-schemasRead the per-branch errors to see which shape the data was meant to satisfy

Not Yet Supported

This validator covers the keywords used in the overwhelming majority of real-world schemas. A few less common 2020-12 keywords aren't implemented: patternProperties, contains / minContains / maxContains, dependentRequired / dependentSchemas, unevaluatedProperties, and prefixItems(tuple validation instead uses the older draft-07 "items as an array" form). $ref only resolves local pointers within the same document — it does not fetch external schema files over the network. If your production validator (Ajv, jsonschema, etc.) relies on any of these, double-check behavior there before treating this tool as the final word.

Frequently Asked Questions

It implements the core keyword set shared across draft-07 through 2020-12 — type, required, properties, additionalProperties, string/number/array constraints, enum/const, allOf/anyOf/oneOf/not, if/then/else, and $ref/$defs for internal references. It does not perform full formal meta-schema validation or support every 2020-12 vocabulary keyword (see 'Not Yet Supported' above).

Yes. $ref resolves local JSON Pointers like #/$defs/Address or #/definitions/Address, including nested and recursive references, so schemas that reuse shared shapes (Address, Money, LineItem) validate correctly. External file references aren't fetched.

Yes. All validation runs in your browser using JavaScript. Your data is never sent to our servers.

Yes. Set the top-level schema type to 'array' and use 'items' to define the schema each element must match, plus minItems/maxItems/uniqueItems for length and duplicate constraints.

When set to false, any property in the JSON that is not listed in 'properties' will cause a validation error. This is useful for strict API contracts.

Yes — click Share. It copies a URL with both panels compressed into the query string, so opening the link reproduces exactly what you had, with nothing stored on a server.

Related Tools