Structured Output: Get Tables, Lists, and JSON from AI
By default AI answers in paragraphs. That's fine for reading, but useless when you need to drop the result into a spreadsheet or another app. Structured-output prompting is about asking for a specific shape so the answer is immediately reusable.
Short answer
Structured-output prompting is specifying the format you want the answer in — a table with named columns, a bulleted list, or JSON with named fields — so the result is easy to reuse instead of free-form prose.
- Applies to:
- Extracting, organizing, or comparing information you'll reuse elsewhere.
- Keep in mind:
- Still review the values — a tidy structure can contain wrong or invented data.
Key takeaways
- State the exact shape: columns, fields, or list format.
- One small example of the shape makes output far more consistent.
- Great for extraction, comparison tables, and feeding other tools.
How it works
You tell the model the exact structure you want — the columns of a table, the fields of a JSON object, the format of each list item — and, ideally, show a one-line example of that shape. The model then fills the structure with your content. Being explicit about field names and format is what makes the output consistent enough to rely on.
When to use it
- You'll paste the result into a spreadsheet or another system.
- You're extracting fields from messy text (names, dates, amounts).
- You want to compare several items on the same dimensions.
When it fails
- The structure you ask for doesn't fit the content, forcing empty or guessed fields.
- You need long-form explanation — a rigid schema flattens nuance.
- You don't review the values and trust the neat format as if it were accurate.
Before and after
Weaker prompt
Pull out the contact details from this text: [paste].
Stronger prompt
From the text below, extract each contact as a JSON object with keys name, email, and company. If a field is missing, use an empty string — do not guess. Return a JSON array. Text: [paste].
Why: Named fields, an explicit 'don't guess' rule, and a defined return type turn free text into clean data you can use directly, and reduce the chance of invented values.
How to adapt it
- Name every field or column explicitly and say what goes in each.
- Ask for 'unknown' or an empty value when the source doesn't have the data, to discourage invention.
- Give one example row so the model matches your exact format.
Prompts that use this technique
Open any to read, copy, or run it in the playground.
Build a prompt library for your exact job
Describe what you do and IterPrompt organizes proven prompts into your real workflows — a personalized starting point in seconds.
Try a prompt for yourself
Open any prompt and run it in the IterPrompt playground.