LLM Structured Output Validator
Validate LLM JSON output against a JSON Schema, with OpenAI, Anthropic and MCP presets, per-field fixes and sample output. Also has a REST API.
LLM Structured Output Validator
Validation failed, 2 errors
$.createdrequiredAdd required property "created"
$.choices[0].finish_reasonenumUse one of the allowed values: stop, length, function_call, tool_calls, content_filter
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"model": "example-model",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Your order ships on Monday."
},
"finish_reason": "done" <-- error
}
]
}Supported validations
Updated . Provided as is. Check the output before you rely on it in production.
How to use LLM Structured Output Validator
- 1
Define the JSON Schema
Paste your JSON Schema (draft-07) or start from a preset such as an OpenAI function response, Anthropic tool result or MCP tool output.
- 2
Paste the model's output
Paste the JSON the model returned into the validation panel.
- 3
Validate
Validate to check the output against the schema: type mismatches, missing required fields, enum violations and more.
- 4
Read the errors
Each error shows the field path, the expected value and the actual value, and the annotated output marks where it failed.
- 5
Fix and re-validate
Adjust your prompt or schema and validate again. Generate Sample creates a valid example from the schema for reference.
Questions and answers
What is structured output from an LLM?
What JSON Schema versions are supported?
How do I fix 'missing required field' errors?
Can I generate sample valid output from a schema?
Does this replace JSON Formatter?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/structured-output-validator/
For automation planning, fetch the canonical contract at /api/tool/structured-output-validator.json.