Home/Guides/Controlling Output Format in AI Prompts
Prompt Engineering Basics

Controlling Output Format in AI Prompts

Discover how to specify output format in your prompts to get bullet points, tables, code, or structured text on demand.

7 min read

The content of an AI response can be excellent, but if the format is wrong, you'll spend more time reformatting it than the output saved you. Format is the final element of a strong prompt — and the one most people forget to specify. Telling the AI exactly how to structure its output makes the difference between something you copy-paste directly and something you spend ten minutes manually reformatting.

Why Default Formatting Is Usually Wrong for You

AI models default to a narrative prose style with some occasional bullet points — a format that emerged from training data that was mostly articles, essays, and documentation. That format works for some use cases and fails for many others. If you're putting output into a spreadsheet, you need a table. If you're feeding it into code, you need JSON or a specific data structure. If you're using it in a chat, you need short lines without markdown syntax. If you're putting it in a slide deck, you need bullet points with no more than 8 words each. Specifying the format in your prompt is how you get output that fits your destination without any reformatting.

Common Formats and When to Use Them

Markdown bullet points work well for content that will be rendered in Notion, GitHub, or a CMS. Plain numbered steps work well for instructions or processes where order matters. Tables are ideal for comparisons, feature matrices, or any structured data with clear categories. JSON is essential when feeding output directly into code or automations. Code blocks with syntax specification (Python, TypeScript, SQL) ensure the model formats code correctly with appropriate language conventions. Plain paragraphs with no markdown are best for email drafts, Word documents, or anywhere markdown characters would render as literal symbols rather than formatting.

How to Specify Format Clearly

The most reliable way to specify format is to describe the exact structure you want, not just the label. 'Bullet points' is less precise than 'each insight on its own line starting with a dash, no sub-bullets, max 15 words per bullet.' 'A table' is less precise than 'a markdown table with 3 columns: Feature, Free Plan, Pro Plan — one row per feature.' The more your format instruction mirrors the exact structure you need, the less cleanup you'll have to do. If in doubt, show an example: paste a 2-row version of the table you want and ask the model to continue in the same format.

Format Instructions for Structured Data Output

When you need AI output to feed into a system or application, format becomes critical rather than optional. For JSON output, specify the exact schema: 'respond only with a JSON object in this format: {"title": string, "tags": string[], "summary": string}.' For CSV, specify delimiter and column headers. For code, specify the language, whether to include comments, and whether to include test cases. The model is quite good at following format specifications for structured data — but it needs an explicit schema, not just a label like 'JSON' or 'CSV.'

Where to Put Format Instructions in Your Prompt

Format instructions work best at the end of your prompt, after role, context, and task. This positioning ensures they apply to the complete response rather than creating confusion about what they modify. The exception is when the format is a core part of the task itself — for example, 'write a table comparing X and Y' where the table instruction is part of the task definition. In that case, the format is naturally embedded in the task. For all other cases, end your prompt with a 'Format:' or 'Output:' section that specifies exactly what you want.

Using Examples as Format Templates

One of the most powerful format techniques is providing a filled-in example and asking the model to follow the same pattern. Instead of trying to describe a complex structure in prose, simply show two or three rows of what you want and end with 'continue this format for the remaining items.' This approach works for tables, reports, analyses, code documentation, and almost any structured output. The model is remarkably good at pattern-matching from examples — often better than it is at interpreting verbal format descriptions, especially for complex or unusual structures.

Prompt examples

✗ Weak prompt
Compare ChatGPT and Claude.

The model will produce several paragraphs of prose — fine for reading, useless for inserting into a comparison doc, spreadsheet, or presentation. You'll spend time manually extracting and reformatting.

✓ Strong prompt
Compare ChatGPT and Claude across these 5 dimensions: context window, coding ability, writing quality, reasoning, and pricing. Format as a markdown table with one row per dimension and two columns: ChatGPT and Claude. Use 1-2 sentences per cell. No preamble — table only.

The table structure, column names, row count, cell size, and instruction to skip preamble all eliminate reformatting work entirely. The output drops straight into a document.

Practical tips

  • End every prompt with an explicit 'Format:' line specifying the exact structure you need.
  • For JSON or structured data, always paste in the exact schema with field names and types.
  • Add 'no preamble' or 'start directly with the output' to skip the introductory sentence most models generate by default.
  • Provide a 2-3 row example of the format you want and ask the model to continue in that pattern.
  • Match format to destination: markdown for Notion/GitHub, plain text for email/Word, JSON for code/automations.

Continue learning

Structured Outputs GuideOutput Formatting Deep DiveUsing Constraints in Prompts

PromptIt applies the right output format for your use case automatically — no format specification required.

PromptIt applies these prompt engineering principles automatically to build better prompts for your specific task.

✦ Try it free

More Prompt Engineering Basics guides

What is Prompt Engineering?

Learn what prompt engineering is and why it matters for getting better

9 min · Read →

How to Use Role in AI Prompts

Discover how assigning a role to an AI model shapes its tone, expertis

8 min · Read →

How to Add Context to AI Prompts

Learn how providing background context in your prompts leads to more a

8 min · Read →

Defining the Task in Your AI Prompt

Find out how clearly stating the task in your prompt is the single big

8 min · Read →
← Browse all guides