Validate JSON data against a schema. See detailed error paths instantly. Supports draft-07, 2019-09, and 2020-12.

JSON Schema
JSON Data to Validate
Ctrl+EnterValidateCtrl+KClear

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/json-schema

Why JSON Schema validation matters

JSON Schema is the standard way to define what valid JSON looks like for an API contract, configuration file, or data pipeline. It describes the expected shape. It specifies which fields are required. It specifies what types they must be. It specifies what string patterns or numeric ranges are acceptable. It also specifies whether additional fields are allowed. Validating JSON against a schema catches errors before they reach production. An API that accepts arbitrary input will eventually receive malformed data. A schema that runs at the edge rejects bad input immediately with a specific error message rather than a cryptic 500. This validator runs entirely in your browser. Paste your schema on the left and your data on the right. Errors are shown with the exact path to the failing field, so you can fix the problem without guessing. Click Load Example to see a working schema and valid data set.

Common validation keywords

KeywordApplies toExampleEffect
typeAny value"type": "string"Restricts the value to one JSON type: string, number, integer, boolean, object, array, or null.
enumAny value"enum": ["a", "b"]Value must exactly match one of the listed options.
minimum / maximumnumber, integer"minimum": 0Numeric value must fall within the inclusive bound.
minLength / maxLengthstring"minLength": 8String length must fall within the bound, counted in Unicode characters.
patternstring"pattern": "^[A-Z]"String must match the given regular expression.
requiredobject"required": ["id"]Listed property names must be present on the object.
additionalPropertiesobject"additionalProperties": falseRejects any property not named in "properties". Omitted, extra properties are allowed.
itemsarray"items": { "type": "number" }Every array element must satisfy the given subschema.
minItems / maxItemsarray"minItems": 1Array length must fall within the bound.
oneOf / anyOf / allOfAny value"oneOf": [{...}, {...}]Value must match exactly one / at least one / all of the listed subschemas.

Example: validating an API request body

A signup endpoint expects an email and an age of 18 or older. The schema below encodes both rules. The request body next to it fails validation twice: email does not match the email format and age is below the minimum. This validator reports both, with the exact JSON Pointer path to each failing field, instead of stopping at the first error.

Schema

{
  "type": "object",
  "properties": {
    "email": { "type": "string", "format": "email" },
    "age": { "type": "integer", "minimum": 18 }
  },
  "required": ["email", "age"],
  "additionalProperties": false
}

Request body

{
  "email": "not-an-email",
  "age": 15
}

/email must match format "email"
/age must be >= 18

Frequently Asked Questions

What is JSON Schema?

JSON Schema is a vocabulary that lets you annotate and validate JSON documents. It defines the expected structure, types, required fields, and constraints for a JSON object. It is widely used in REST APIs for request/response validation, in configuration files, and in code generation tools.

Which JSON Schema draft versions are supported?

This tool supports draft-07, draft 2019-09, and draft 2020-12. The version is auto-detected from the $schema field at the top of your schema. Draft-07 is the most widely used in practice. If your schema does not declare a $schema version, draft-07 semantics are used by default.

My data has extra fields not listed in the schema, but validation passes. Is this a bug?

No. JSON Schema is open by default. The "properties" keyword only defines constraints for the named fields if they appear. It does not prevent other fields from existing. A schema with "properties": { "name": ..., "age": ... } will happily accept { "name": "Alice", "age": 30, "role": "admin" } because "role" is simply unspecified, not forbidden. To reject extra fields, add "additionalProperties": false to your schema. This tells the validator that no property outside the listed ones is allowed. For the 2019-09 and 2020-12 drafts, "unevaluatedProperties": false is the stricter equivalent that also covers properties introduced by "allOf", "anyOf", and "if/then" branches.

What do "required" and "additionalProperties" do?

"required" is an array of property names that must be present in the object. If a required property is missing, validation fails with a clear error. "additionalProperties": false means the object must not contain any properties not listed in the "properties" keyword. This is useful for strict API contracts.

What format validators are available?

This validator supports format keywords including: email, uri, date, date-time, time, ipv4, ipv6, uuid, hostname, and json-pointer. For example, setting format: "email" will validate that the value looks like a valid email address.

Can I use this in my CI/CD pipeline?

This browser tool is for interactive validation and prototyping. For CI/CD pipelines, use a JSON Schema validation library in your Node.js scripts or a standalone CLI validator. The schema you build and test here can be copy-pasted directly into those tools without modification.

Related Tools

From the Blog