Control the AI Output Format (JSON, Tables, Lists)
Get consistent, parseable output by specifying the exact format, fields, and what to exclude.
Direct answer
To control the output format, state exactly what you want — JSON with named fields, a Markdown table, or a bullet list — plus any length limits and what to exclude (no preamble, no explanations). Provide a template or example of the format. Being explicit is what makes the output consistent and parseable.
Open the Prompt OptimizerWhen to use this
- You need machine-readable output like JSON.
- The model adds chatty preambles you do not want.
- You want the same structure every time for automation.
Steps
- Name the format: return valid JSON, a Markdown table, or a numbered list.
- List the exact fields or columns and their types.
- State exclusions: no preamble, no markdown fences, no commentary.
- Give a small template or example of the exact shape.
- Add a length or item-count limit if you need one.
Example
summarize this review
Summarize the review below. Return only valid JSON, no preamble, in this shape:
{
"sentiment": "positive | negative | neutral",
"summary": "one sentence",
"topics": ["..."]
}
Review: <paste review here>Common mistakes
- Without an explicit format the model defaults to prose; always state the shape.
- For JSON, say 'return only valid JSON, no code fences or commentary' or you get extra text.
- Give a template; describing the format in words alone is less reliable than showing it.
FAQ
- How do I make ChatGPT return JSON?
- Tell it to return only valid JSON with named fields, show the exact shape as a template, and say no preamble or code fences. An example of the structure is the most reliable approach.
- How do I stop the model adding extra commentary?
- State the exclusions explicitly: no preamble, no explanations, output only the requested format. Constraints on what NOT to include work as well as constraints on what to include.
- Why is my output format inconsistent?
- Usually the format is described vaguely or not at all. Provide a concrete template and constraints so the model has one clear shape to follow.
Related Prompt Optimizer guides
How to Structure a Prompt (Template)
The building blocks of a strong prompt — role, context, task, constraints, output format, and examples — with a reusable template.
Write a Prompt From a Rough Idea
Turn a one-line idea of what you want into a full, ready-to-paste structured prompt.
Few-Shot Prompting: Add Examples to Your Prompt
Show the model one to three input-output examples so it copies the pattern you want.
Chain-of-Thought Prompting: Ask for Step-by-Step Reasoning
Prompt the model to reason step by step to improve accuracy on multi-step math, logic, and planning tasks.
Role and Persona Prompting (Act As)
Assign the model a role or persona to control tone, depth, and vocabulary in its answers.
Desk gear for long writing sessions
A few things that help if you write docs, tickets, and specs on a laptop all day.
Anker 5-in-1 USB-C Hub
One cable turns a laptop into a desk setup. Drives a 4K display, charges at up to 85W, and adds three data ports.
- 4K HDMI output
- 85W max power delivery
- 1x USB-C + 2x USB-A, 5Gbps each
- MacBook Pro, MacBook Air, Dell
Dell 27" S2725QC 4K
The monitor I write and review documents on. 163 PPI keeps small text sharp, and USB-C carries video and power on one cable.
- 3840x2160 IPS, 163 PPI
- 120Hz, 4ms, FreeSync Premium
- 99% sRGB
- USB-C, HDMI, DisplayPort
Apple MacBook Neo 13" (A18 Pro)
The cheapest way into an Apple-silicon machine that runs local models. Fanless, and the Liquid Retina panel holds small text at a full day of reading.
- A18 Pro chip, built for Apple Intelligence
- 8GB unified memory, 256GB SSD
- 13-inch Liquid Retina display
- 1080p FaceTime HD camera
Amazon affiliate links. We earn a commission on qualifying purchases at no extra cost to you.