How do I get AI to give answers in a table or a fixed format?
1 Answer
Getting AI to produce output in a specific format, such as a table, checklist, template or JSON, saves editing time and makes results easier to use. A few prompt techniques make formatting much more reliable.
1. Name the format explicitly. Do not leave it to chance. "Give the answer as a table with columns: Feature, Plan A, Plan B, Notes." "Use a numbered list of 7 steps, each under 20 words."
2. Show the exact structure. Provide a template the AI should fill:
"Use this format for each product:
Name:
Price:
Best for:
Main drawback:"
3. Give an example of the finished output. One filled-in example is often more effective than a description.
4. Specify details that matter: column order, units, date formats, currency, capitalisation and what to put when information is missing, such as "write N/A."
5. Say what not to include. "No introduction or conclusion, only the table" prevents extra text around your format.
6. Match the format to the destination. "Format for WhatsApp," "format as plain text for an SMS," "format as HTML for a website" or "format as a CSV I can paste into Excel."
For structured data, such as JSON for software:
Provide the exact schema with field names and types.
Say "return only valid JSON, no explanation."
Include an example object.
Developers using APIs should use the structured output or JSON mode features many providers offer, which guarantee the output follows a schema.
Common formats that work well:
Comparison tables for products, plans or options.
Checklists for procedures.
Pros and cons lists for decisions.
Timelines for project plans.
Q&A format for FAQs.
Templates for reports, emails or forms.
If the AI keeps drifting from the format:
Repeat the format instruction at the end of your prompt.
Start a new chat with the format requirements up front.
Save the format in custom instructions, a project or a custom assistant for repeated use.
For long outputs, ask for the format in smaller batches.
Formatting is one of the easiest ways to make AI output immediately usable. The clearer the structure you request, the less time you spend reorganising results afterwards.