format

Structured output

Structured output is any production prompt pattern that forces a language model to return data in a deterministic, machine-parseable form (JSON, XML, custom).

Structured output is the umbrella term for JSON mode, json_schema, XML tagging (Claude), tool-call arguments, and any other constraint that makes the model's output parseable by downstream code without retries. In 2026 the most reliable form is JSON Schema-constrained decoding (OpenAI's strict mode, Anthropic via tool use, Gemini's response_schema) — the model literally cannot emit invalid output. This is the production-grade replacement for 'return JSON' prompting plus regex fallbacks.

When to use structured output

Common mistakes

FAQ

What is structured output?

Structured output is any production prompt pattern that forces a language model to return data in a deterministic, machine-parseable form (JSON, XML, custom).

When should I use structured output?

Any output that downstream code parses. Extraction, classification, form-filling, tool arguments.

What are the most common mistakes with structured output?

Asking for JSON in the system prompt without a schema. Schemas with deeply nested unions — smaller models get confused.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/structured-output.md.