Free tool
JSON schema validator for LLM output
On this page
The short answer
- Paste a JSON Schema and a model's raw output. The validator reports a strict parse, a lenient parse and every schema error by JSON Pointer path.
- Why both parses: in the recorded run behind our demo (13 Nov 2026), Gemma 4 26B was told to reply only with JSON and wrapped it in a
```jsonfence. The JSON was right; a strict parse still fails. - It also checks the schema for OpenAI Structured Outputs strict mode basics (all properties required, no extra properties).
- Runs in your browser. Nothing is uploaded.
Key numbers
- GLM-4.7 Flash passed a strict JSON parse on 0 of 8 structured-output cases, but 7 of 8 after stripping fences or extra text. (Litmiq LLM Reliability Benchmark, 12 Nov 2026)
- Told to “reply only with JSON”, Gemma 4 26B wrapped correct JSON in a ```json code fence, which fails a strict parse. (Litmiq recorded demo run, 13 Nov 2026)
Validator
What it checks
- Strict parse: the whole output is exactly one JSON value. Code fences or a leading sentence fail this.
- Lenient parse: after removing a code fence and any text around the first JSON object or array.
- Schema: every error, with the JSON Pointer path of the value that failed (for example
/items/0/qty). - Strict-mode readiness: basic checks of the schema itself against OpenAI's Structured Outputs rules.
To test this across many inputs and models, write the format rule into your scoring criteria and run a suite: start from the JSON extraction test cases or the structured-output template. Our reliability benchmark measures strict and lenient parse rates for 12 open models.
Supported keywords
| Group | Keywords |
|---|---|
| Types | type (string, number, integer, boolean, object, array, null; arrays of types) |
| Values | enum, const, minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf |
| Strings | minLength, maxLength, pattern, format (email, date, date-time, uri, uuid) |
| Objects | properties, required, additionalProperties, minProperties, maxProperties |
| Arrays | items, prefixItems, minItems, maxItems, uniqueItems |
| Composition | allOf, anyOf, oneOf, not, local $ref (#/…) |
OpenAI strict mode
With Structured Outputs in strict mode, the API constrains generation to your schema, but only schemas that follow its rules are accepted. The validator flags the two most common blockers: objects without "additionalProperties": false, and properties missing from required. Other providers have their own rules; validate outputs in code either way.
FAQ
Why do strict and lenient parse differ?
Models often wrap JSON in a code fence or add a sentence before it. A strict parse of the raw output then fails even though the JSON inside is fine. If your code doesn't strip that, treat it as a failure; the validator shows both results so you can decide.
Which JSON Schema version does it support?
A practical subset of draft 2020-12 that covers what LLM output schemas use: types, required, additionalProperties, enum, const, string and number limits, pattern, common formats, arrays, allOf, anyOf, oneOf, not and local $ref. Remote $ref and dynamic references are not supported.
What does the strict-mode check do?
It flags the two most common reasons OpenAI's Structured Outputs strict mode rejects a schema: an object without additionalProperties: false, and a property that is not listed in required (use a null type for optional fields). It is a basic check, not a full compatibility test.
Is my data sent anywhere?
No. Parsing and validation run in your browser.
Get model deprecation alerts
We email you when OpenAI, Anthropic or Google publish a new shutdown date for a model on our tracker. Sent by hand from hello@litmiq.com, a few times a month at most. Unsubscribe by replying.
We store only your email, through our form provider. See the privacy policy.
Validate one output, then test a hundred
Run your JSON prompt on several models with a JSON-only rule in the scoring criteria. Free, in your browser.
- Free, no signup
- Runs in your browser
- Your OpenAI key, sent only to OpenAI