Skip to content
← All lessons

Lesson 04 · Intermediate · 3 min

How to control an AI's output format

Tell the model the exact shape of the answer so you never have to re-ask for formatting.

Why

Without a format, you get prose when you wanted JSON, or a wall of text when you wanted a table. Production tools specify a strict output contract so responses are parseable and predictable.

How

State the shape explicitly: 'Return JSON: { subject, body, cta }' or 'Use a markdown table with columns X, Y, Z.' Include length limits where relevant.

Try it

Add an explicit output format to this prompt. Aim for 75+.

71structure

Target: 75. Keep working the prompt. The score moves as you type.

  • Constraints: State limits and do/don't rules, e.g. "Keep it under 200 words. Do not invent APIs."
  • Output format: Specify the exact shape, e.g. "Return JSON: { title, steps[] }" or "Use a markdown table.".
  • Examples (few-shot): Add one input→output example to anchor tone, format, and edge handling.

Now put it to work: score a prompt you actually use on the desk and see whether this part is one it was missing. This is one of seven parts. To see all of them already in place, the templates are the finished shape; to practise on something new, the daily drill posts one brief a day.