~/tools / JSON Schema Validator
JSON Schema Validator — Check JSON against a JSON Schema
Check JSON data against a JSON Schema and see each problem with its path and the rule that failed. Covers the main keywords of Draft 2020-12. Useful for checking the structured output of an AI model. Nothing leaves your browser.
Follows JSON Schema Draft 2020-12 for the keywords it supports. It reads $ref only inside the same schema.
Everything runs in your browser. The schema and the data are not uploaded.
A JSON Schema describes what valid JSON looks like: its types, required properties, allowed values and ranges. This tool checks a piece of JSON against a schema and lists every problem with its location in the data and the schema keyword that failed. AI APIs can constrain a model's reply to a schema, but the reply may still be wrong in its values, refused, or cut off, so it is worth checking it yourself. The keywords the tool does not check, such as format, are listed when your schema uses them, so a pass is never silently weaker than it looks.
Use Cases
- Checking that an AI model's structured output matches the schema you gave it
- Testing a schema against a few valid and invalid samples before using it in an API
- Finding which property in a large JSON document breaks the rules
Usage
- Paste the schema on the left and the JSON data on the right, or load the example.
- Read the result: a pass, or a list of problems with the path in the data and the rule that failed.
- Check the notice about keywords that were not verified, if one appears.
What a schema checks, and what it does not
- properties checks only the properties that are present. A property is mandatory only if its name is listed in required, so a property that is not listed may be missing.
- additionalProperties applies to names that match neither properties nor patternProperties. If it is omitted, extra properties are allowed.
- integer matches any number with a zero fractional part.
- pattern is an ECMA-262 regular expression and is not anchored: the pattern b matches the string abc. Add ^ and $ when the whole string must match.
- minLength and maxLength count characters as RFC 8259 defines them, so an emoji counts as one.
- format is an annotation by default, and checking it is optional. This tool does not check it and says so when a schema uses it.
- Unknown keywords are treated as annotations, so a misspelled keyword such as requierd is ignored and does not fail the schema.
Arrays: 2020-12 and earlier drafts
| Draft | Schemas for the first items | Schema for the rest |
|---|---|---|
| 2020-12 | prefixItems | items |
| draft-07 and earlier | items as an array | additionalItems |
This tool reads both forms. In 2020-12, items: false takes the place of additionalItems: false.
What AI structured-output features accept
Each vendor accepts only a subset of JSON Schema, and the three document it differently.
| Vendor | What the documentation says |
|---|---|
| OpenAI | The root must be an object. Every property must be listed in required (an optional value is written as a type that also allows null), and every object needs additionalProperties: false. allOf, not, dependentRequired, dependentSchemas and if/then/else are not supported. |
| Anthropic | additionalProperties must be false. Recursive schemas, minimum, maximum and multipleOf, minLength and maxLength, and an array minItems other than 0 or 1 are not supported. An unsupported feature returns a 400 error. |
| Google Gemini | Only a subset of JSON Schema is supported. minLength, maxLength, minProperties, maxProperties, uniqueItems, contains, minContains and maxContains are stripped and ignored instead of raising an error. |
A schema that passes this validator may still be rejected, or only partly enforced, by a vendor's feature. Check the vendor's documentation, and validate the response yourself.
Validate the response yourself
- Google says the output can match the schema and still be wrong in meaning, and tells you to validate the values in your application.
- Anthropic notes that an enum or const value may come back differing only in capitalization, without an error.
- OpenAI says a refusal does not necessarily follow the schema, and that a response cut off by the maximum token limit is incomplete.
- Anthropic says a reply cut off by max_tokens may not match the schema. Check why the model stopped before you parse.
Sources (checked 2026-10-23): JSON Schema 2020-12: Core / JSON Schema 2020-12: Validation / JSON Schema 2020-12: Release notes / OpenAI: Structured Outputs / Anthropic: Structured outputs / Google AI for Developers: Structured output
FAQ
Which JSON Schema version does it follow?
Draft 2020-12. It also reads the older array forms from draft-07, where items can be an array and additionalItems covers the rest. It accepts $ref to definitions inside the same schema ($defs or definitions) and does not fetch external schemas.
Which keywords does it check?
type, enum, const, the number and string limits, pattern, the array keywords (items, prefixItems, minItems, maxItems, uniqueItems, contains), the object keywords (properties, patternProperties, additionalProperties, required, propertyNames, dependentRequired and others), allOf, anyOf, oneOf, not and if/then/else.
What does it not check?
format, unevaluatedProperties, unevaluatedItems, $dynamicRef and contentMediaType are not checked. JSON Schema treats format as an annotation by default, and checking it is optional. When your schema uses one of these, the tool says so.
Why does a misspelled keyword not cause an error?
JSON Schema treats unknown keywords as annotations, so a typo such as requierd is ignored and the schema still passes. The tool reports a wrong value for a keyword it knows, such as a type that does not exist, but it cannot know that you meant another word.
Will a schema that passes here work with an AI vendor's structured outputs?
Not necessarily. Each vendor supports only a subset of JSON Schema. OpenAI requires every property to be required and additionalProperties to be false, Anthropic does not support number or string length limits, and Gemini ignores several keywords. See the vendor notes below the tool.
Is my data sent to a server?
No. Both the schema and the data are checked in your browser.