LLM JSON Schema Validator
Validate JSON Schemas for OpenAI strict mode, function calling, Anthropic tool use, and Gemini controlled generation. Catch vendor-specific schema errors before shipping.
- $.properties.title Property "title" has no description. Claude relies heavily on descriptions to populate tool input correctly.
- $.properties.tags Property "tags" has no description. Claude relies heavily on descriptions to populate tool input correctly.
- $.properties.priority Property "priority" has no description. Claude relies heavily on descriptions to populate tool input correctly.
Vendor rules are hand-coded from each provider's structured-output documentation as of May 2026. Vendors loosen and tighten their schema subsets over time — when in doubt, check the linked docs.
How to use the llm json schema validator
Paste your JSON Schema on the left and a sample JSON response on the right. The validator checks the sample against the schema with ajv, and separately reports which LLM providers (OpenAI strict mode, OpenAI function calling, Anthropic tool use, Google Gemini controlled generation) will accept the schema, along with vendor-specific gotchas. Each vendor enforces a different subset of JSON Schema.
Formula & explanation
Validation uses ajv (JSON Schema draft 2020-12). Vendor compatibility uses hand-curated rules derived from each vendor's structured-output documentation — see lib/llm-schema-rules.ts in the source for citations.
Examples
An OpenAI strict-mode schema must have additionalProperties: false on every object and list every property in "required". Anthropic accepts a much broader subset. Gemini doesn't support oneOf/anyOf/allOf or $ref at all.
Frequently asked questions
- Why doesn't my schema work with OpenAI strict mode?
- OpenAI's strict mode (response_format: { type: "json_schema", strict: true }) requires every object to have additionalProperties: false, every property listed in "required", and forbids oneOf, allOf, and most validation keywords like minLength or pattern. Paste your schema in this tool and the OpenAI Strict column will list every constraint violation with a fix suggestion.
- What's the difference between OpenAI strict and function calling?
- Strict mode (a.k.a. Structured Outputs) guarantees the model emits JSON matching your schema; in exchange it imposes hard subset restrictions. Function calling (non-strict) is steered by the schema but the model can deviate — most JSON Schema keywords work as hints, but accuracy degrades on deeply nested or large schemas.
- Does Anthropic enforce additionalProperties: false?
- No. Anthropic's tool-use schema is the most permissive of the major vendors. It accepts standard JSON Schema including additionalProperties either way, oneOf/anyOf/allOf, and most validation keywords. The main practical limit is property count: keeping tools under ~20 top-level properties improves accuracy.
- Why doesn't Gemini support oneOf or $ref?
- Google Gemini's controlled generation uses a subset based on OpenAPI 3.0 schema, which historically didn't support these keywords. You need to inline any $ref'd subschemas and restructure unions as enums or a single type. The tool flags both as errors when you paste a schema with them.
- Can I get an exact token count for my schema?
- Not in this tool — pop over to the Token Counter for that. Schemas themselves count against your context window; deeply nested schemas can use a surprising number of tokens, especially in OpenAI function calling where the schema is sent on every turn.
- Does this validate offline?
- Yes. ajv runs entirely in your browser, and the vendor rules are hand-coded JavaScript. Nothing is sent to OpenAI, Anthropic, or Google — we just check your schema against the documented constraints.
Related developer tools tools
- JSON FormatterPretty-print, minify, and validate JSON. Detects syntax errors with line numbers and supports nested structures of any depth.
- JSON DiffCompare two JSON values semantically. Ignores key order; shows added, removed, and changed fields with their JSONPath — great for diffing API responses and config files.
- XML to JSON ConverterConvert XML to JSON for legacy API integration, SOAP responses, and config migration. Handles attributes, namespaces, and text content.
- JSON to XML ConverterConvert JSON objects and arrays to well-formed XML. Maps object keys to elements, array items to repeated elements, with optional root wrapper.
- JSON to YAML ConverterConvert JSON to clean indented YAML for Kubernetes manifests, Docker Compose, CI configs, and Helm charts. Preserves nested structures.
- JSON to CSV ConverterConvert JSON arrays to CSV with automatic header detection from object keys. Handles nested values and arbitrary delimiters.