JSON Schema Validator — Draft 2020-12
Validate JSON against a JSON Schema (draft 2020-12, 2019-09, draft-07) with detailed error messages. Ideal for LLM structured output and API contracts.
JSON Schema Validator
How it works
- Paste a JSON Schema (any draft version) on the left and a JSON document on the right.
- Click Validate — the schema is parsed and the document is validated against every constraint.
- Errors show the exact path (e.g.
user.email), the failed keyword (type,required,pattern,enum), and a human-readable message. - Use the AI Template button to load a preset schema for OpenAI function calling / Claude tool use.
About JSON Schema Validator
JSON Schema is a declarative vocabulary for describing the structure and constraints of JSON documents — types, required fields, ranges, patterns, enums, nested objects, and conditional logic. Every major AI platform now supports JSON Schema natively for structured outputs: OpenAI's response_format.json_schema, Anthropic's tool definitions, and Gemini's genai.protos.Schema all expect valid JSON Schema. When you define a schema for an LLM response, this tool lets you validate both the schema itself and the actual output the model produces — catching missing fields, wrong types, and constraint violations before they reach production code.
This validator supports type, required, enum, const, properties, additionalProperties, patternProperties, allOf, anyOf, oneOf, not, if/then/else, minLength/maxLength, pattern, minimum/maximum/exclusiveMinimum/exclusiveMaximum/multipleOf, minItems/maxItems/uniqueItems/contains, items, and $ref (local references only). All processing happens in your browser — no document or schema is uploaded anywhere.
What a schema does and does not enforce
A JSON Schema describes the shape of a document: which keys are required, what type each value is, what pattern a string matches, what range a number falls in. It does not validate semantics — a schema can confirm an age is a non-negative integer and still have no opinion about whether it is plausible.
The validator here supports draft 2020-12, 2019-09 and draft-07, and reports failures with the instance path so you can jump straight to the offending value in a large document.
Validating LLM structured output
When a model is constrained to return a JSON object, the schema is the contract, and the failure mode is usually a mismatch between the schema you sent and the response you got. The presets on this page are shaped for the formats OpenAI, Anthropic and Gemini actually accept, including the strict-mode requirements those APIs impose.
Test with the worst realistic output, not a clean sample. The cases that break in production are optional fields omitted, an extra property added by a fine-tuned model, or a nested object returned as a string.
Next steps
- JSON Formatter— clean up errors first
Frequently Asked Questions
How do I validate JSON against a JSON Schema?
Which JSON Schema drafts are supported?
Is my data sent to a server?
Do I need an account or API key?
Can I use these tools offline?
All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.