JSON

JSON Schema Validator

Paste a JSON Schema and a JSON document to check that the data conforms. Each problem is listed with the exact location, the keyword that failed and a plain-English message.

Ready.

What it does

JSON Schema describes the shape of JSON: which properties exist, their types, ranges and patterns. Validating data against a schema catches bad API payloads, broken config files and typos before they reach your code.

Supported keywords

  • Types and values: type, enum, const, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf.
  • Strings: minLength, maxLength, pattern, and format for date-time, date, time, email, hostname, ipv4, ipv6, uri, uuid, json-pointer and regex.
  • Arrays: items, prefixItems, contains, minContains, maxContains, minItems, maxItems, uniqueItems.
  • Objects: properties, required, additionalProperties, patternProperties, propertyNames, minProperties, maxProperties, dependentRequired, dependentSchemas.
  • Logic: allOf, anyOf, oneOf, not, if / then / else, and local $ref to #/$defs/....

Limits

This is a practical validator for the keywords above, not a full implementation of the specification. unevaluatedProperties, unevaluatedItems, dynamic references and remote $ref URLs are not supported; ignored keywords are reported under the result. Format checks are optional because the specification treats formats as annotations by default.

Example: four errors, each with a path

Take this schema, which requires an integer id of at least 1, an email address, at most three tags and no other properties:

{
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": { "type": "integer", "minimum": 1 },
    "email": { "type": "string", "format": "email" },
    "tags": { "type": "array", "items": { "type": "string" }, "maxItems": 3 }
  },
  "additionalProperties": false
}

and this data:

{ "id": 0, "email": "not-an-email", "tags": ["a", "b", "c", "d"], "extra": true }

The validator lists every error with the path in the data, the keyword that failed and the location in the schema:

  • /id — minimum: must be >= 1
  • /email — format: must be a valid email
  • /tags — maxItems: must have at most 3 item(s)
  • (root) — additionalProperties: must not have the additional property "extra"

Reading the result

The data path points to the value that is wrong, so you can fix the document, and the schema path points to the rule that was broken, so you can check whether the rule itself is right. If a document has several problems, all of them are listed together instead of stopping at the first one. To find the exact line of a syntax error before you validate against a schema, use the JSON Validator.

Frequently asked questions

Which JSON Schema features are not supported?

unevaluatedProperties, unevaluatedItems, dynamic references and remote $ref URLs. The tool ignores such keywords but tells you which ones it ignored (“Not supported and ignored: …”), so a “Valid” result never hides that a rule was skipped.

Can I validate an API response?

Yes. Paste a sample response as the data and the schema from your API documentation. For an OpenAPI document, validate its structure first with the OpenAPI Validator.

Is my data uploaded?

No. The schema and the data are checked in your browser.

Privacy

This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.

Share this tool

Your data is not included in this link.