AI Compass

Structured output (JSON, tables)

Asking AI to answer in a fixed format such as a table or JSON so results are easy to use.

What is it?

Structured output means the model answers in a predictable shape: a table with set columns, a checklist, or a data format like JSON that other software can read. Instead of free text, you describe the fields you need and the model fills them in.

Many AI APIs now offer a feature where developers provide a schema (a description of the exact fields and types) and the model's reply is constrained to match it. In everyday chat, a clear description and an example of the format usually works well.

Which models use it?

  • OpenAI's API offers structured outputs that follow a JSON schema.
  • Anthropic's and Google's APIs support JSON output and tool definitions with schemas.
  • Chat assistants such as ChatGPT, Claude and Gemini can produce tables and lists on request.
  • Spreadsheet and automation tools often pass AI output as structured data between steps.

How to use it

  1. Decide what fields you need and what each one means.
  2. Describe the format exactly, for example the column names or JSON keys.
  3. Show one short example of a correctly filled result.
  4. Say what to do when information is missing, such as leaving the field empty.
  5. In code, validate the output against the expected structure before using it.
  6. Check a sample of results by hand for accuracy, not just format.

Benefits

  • Easy to paste into spreadsheets, databases or other apps.
  • Consistent results across many requests.
  • Makes comparison and review faster.
  • Reduces manual copying and reformatting.

Limits and risks

  • A correct format does not mean the content is correct.
  • Without schema enforcement, the model may occasionally break the format.
  • Forcing a rigid structure can drop useful nuance.
  • Very large tables may be cut off if the reply hits the length limit.

Prompt template

Copy it, replace the parts in [brackets] and paste it into any AI chat.

Extract the following from the text below and return it as a table with these columns: [column 1], [column 2], [column 3]. Use one row per [item]. If a value is not in the text, write "not stated" instead of guessing. After the table, list anything that was unclear.

Text: [paste text]

More in Using AI well

Learn AI in the AI Compass app

Every guide and dictionary card is also in the AI Compass app, with saved items, search and “Try it” buttons that open chat, image or video with the example filled in. Reading is free; creating uses credits, and the price is shown before you start.