# JSON mode (structured output)

**Source:** https://promtable.com/glossary/json-mode

> JSON mode forces a language model to emit only syntactically valid JSON, usually conforming to a schema you supply.

---
JSON mode forces a language model to emit only syntactically valid JSON, usually conforming to a schema you supply.

Most major APIs (OpenAI `response_format`, Anthropic via tool-use, Gemini `response_schema`) let you guarantee the model's reply parses as JSON, and increasingly that it matches a JSON Schema. Constrained decoding makes this deterministic — the model literally cannot emit invalid syntax — eliminating retry loops for downstream code. Use it for extraction, classification, form-filling, and tool-call arguments. The trade-off is slightly more rigid responses and occasional schema confusion on complex nested structures.

## When to use

- Feeding model output into deterministic downstream code.
- Extraction tasks (resume → JSON, invoice → JSON).
- Form-style UIs where the model fills fields.

## Common mistakes

- Over-specifying — deeply nested schemas confuse smaller models.
- Using JSON mode without specifying the schema — "valid JSON" alone still drifts.

## Related terms

- [function-calling](https://promtable.com/glossary/function-calling)
- [structured-output](https://promtable.com/glossary/structured-output)
- [system-prompt](https://promtable.com/glossary/system-prompt)

*Last updated: 2026-06-01*
---

Original page: https://promtable.com/glossary/json-mode
Maintained by Promtable (https://promtable.com). Content: CC BY 4.0. Cite as "Promtable — https://promtable.com/glossary/json-mode".
Contact: info@vibecodingturkey.com.