Interactive eBook BuilderInteractive eBook Builder
$59 · unlimited access, unlimited eBooksGet it for $59

· By · 10 min read

How to Get ChatGPT to Output JSON, Tables, or a Fixed Outline

promptsaiwritingebook

If you want ChatGPT to return JSON, a table or a fixed outline, you have to specify the shape as carefully as the content. In the chat interface, that usually means: name every field or heading, show one filled example, and forbid extra commentary. On the API, OpenAI offers a stronger option. In Structured model outputs, OpenAI describes Structured Outputs as a way to constrain completed, non-refusal model output to a JSON Schema you supply. The same page lists benefits such as schema adherence for required fields and enums, and it notes that you still have to handle refusals, incomplete responses and API errors. That API feature is not automatically present in an ordinary ChatGPT thread, so do not assume a chat prompt has the same guarantees.

This article is about the writer-facing problem: you want a chapter inventory, a quiz key or a table of worksheet fields that you can paste into a spreadsheet or a Notion database. For Claude-specific format control, use How to Make Claude Follow a Strict Output Format. The delimiter habits in How to Use Delimiters in Prompts still apply here: keep the schema, the notes and the request in clearly marked blocks.

For eBook and workbook projects, Interactive eBook Builder is a $59 one-time Notion AI template with Spec Builder, Drafter, Polisher and SEO BOT already set up. A structured brief is useful when you want a chapter map, a quiz key or a worksheet inventory you can inspect before anyone drafts prose. The Prompt Engineering Lab can test a format on a clean brief and on a messy one that tries to add commentary or missing fields. Notion AI access and usage are separate from the purchase. The examples below are teaching prompts written for this article. They are not paid Builder prompts, and they are not recorded model outputs.

What should you ask for: JSON, a table, or a locked outline?

Pick the shape that you will actually use.

JSON is not automatically more professional. If you cannot read it at a glance, and you do not have a parser, ask for a table. If you do ask for JSON, keep the schema small. A 30-key object with nested lists will break more often in chat than a five-key object.

What does a strict chat prompt need?

A reliable brief has four parts:

  1. The shape, including required keys or headings.
  2. One short example that matches the shape exactly.
  3. Rules for missing data: use null, an empty list, or “Need from me,” rather than inventing a value.
  4. A “return only the object / table / outline” line, plus a rule against markdown fences if your downstream tool cannot stand them.

If you use a reusable prompt template, the shape belongs in the standing part of the template. The notes change; the keys should not.

When you are calling the API, prefer Structured Outputs with a real schema over a longer threat in the prompt. OpenAI’s documentation is written for that setting. In ChatGPT, you are still prompting, so you still have to validate.

Example 1: a chapter inventory in JSON

A vague request is:

Give me the book structure in JSON.

The model may return a different shape each time, wrap it in an explanation, or invent chapters.

Return one JSON object only. No markdown, no commentary, no code
fences. Use exactly these keys:
- title (string)
- reader (string)
- chapters (array of objects, each with heading, job, word_budget,
  workbook_close)

Rules:
- Include exactly five chapters.
- If a word budget is not in my notes, use null, not a guess.
- Do not add keys.
- Do not invent a subtitle, a price, or a marketing hook.

Example of the shape (do not copy the content):
{"title":"Example","reader":"Example reader","chapters":[{"heading":"H1","job":"What the reader can do","word_budget":300,"workbook_close":"Fill-in line"}]}

Notes:
- Title: Name a Floor Rate
- Reader: new freelance designers who undercharge
- I want five chapters that move from defining a floor to saying it
  on a call
- I have not set word budgets yet
- Each chapter should end with one action

After you get the object, paste it into a JSON validator, or open it in a text editor and check the keys. If a field you left unknown now contains a number, treat that as a miss, not as a helpful default.

Example 2: a quiz key as a table

Writers often need this more than they need JSON.

Create a five-item quiz key as a Markdown table with these columns
only: Item, Stem, Correct answer, Source in the chapter, Distractor
to avoid.

Rules:
- Use only the passage I paste.
- If an item would require a fact that is not in the passage, skip
  it and write "Need from me" in the Stem column.
- Do not add an explanation section after the table.
- Do not invent a "40 percent" statistic or any other figure.

Passage:
[paste]

If the model adds a sixth column or a paragraph of teaching notes, run the prompt again and say “the previous reply added commentary; return the table only.” Then check each “Correct answer” against the passage yourself. Structured output is about shape. Correctness is still your job.

Example 3: a locked outline the draft must follow

When the next step is prose, a fixed heading list is the contract.

Return this outline with the headings unchanged, in this order:

1. Why a floor is not a pricing menu
2. The $90 example
3. What to say on the call
4. What to do if you freeze
5. Fill-in: my floor for this job

Under each heading, write one sentence that states the job of that
section, 20 words or fewer. Do not rename headings. Do not add
heading 6. Do not include a preface.

If you later send this outline to a drafting prompt, paste it as a block and say “do not add or rename headings.” That is how a locked outline earns its keep.

What should you do when ChatGPT ignores the format?

First, shorten the request. A long preface about role and motivation is a common reason the schema gets lost. Put the shape first, the notes second, the “return only this” rule last.

Second, show one example of the exact shape, not a different shape. A mismatch between the example and the instructions will produce messy output.

Third, if you are in an API, use Structured Outputs instead of a longer prompt. If you are in ChatGPT and the result still arrives wrapped in commentary, ask for a second pass that extracts only the object or table from the previous reply.

Fourth, validate. For JSON, parse it. For a table, check the column count. For an outline, check that the headings match, character for character. A result that looks structured and fails these checks should not go into a database or a book map.

Should you ask for markdown fences, or forbid them?

This depends on where the result is going. If you will copy the JSON into a validator or a code tool that expects a raw object, forbid fences and commentary. If you will read the result in the chat and then paste a table into a document, a Markdown table is easier, and a fence around it is usually harmless.

Be consistent with the example. If the example is raw JSON and the reply arrives inside a json fence, that is already a format miss for a parser. Ask once for a raw object. If the app still wraps it, do a second “extract only the object” pass, then parse that. Do not hand-edit broken JSON to “make it work” unless you also check that you did not change a value.

How should you use this in a book workspace?

Spec Builder can store a chapter inventory once you have accepted the object or table. Drafter should receive a locked outline, not a newly invented one, unless you are intentionally re-planning. A quiz or worksheet inventory should be checked before Polisher or SEO BOT ever sees the page. In the Prompt Engineering Lab, test the same schema on a clean notes block and on a failure case that omits a required figure. The failure case should produce null or “Need from me,” not a made-up number.

FAQ

How do I get ChatGPT to output JSON?

Name the exact keys, require a single object, give one example of the shape, and say to return only that object, with a rule for missing values. Then parse the result. If you are using the API, OpenAI’s Structured Outputs can enforce a JSON Schema, which is stricter than a chat prompt. The chat app still needs a clear brief and a manual check.

Why does ChatGPT ignore my format?

Often the prompt asked for two things at once, such as “explain your plan and then give me JSON,” or the example did not match the schema, or the request was buried under a long role description. Put the shape where it is hard to miss, remove the request for commentary, and retry. If you need a guarantee, use an API schema, not a longer warning.

How do I get ChatGPT to fill a table or a fixed outline?

Give the column names or the exact headings, forbid extras, and show the empty shape. For an outline, say “do not rename or add headings.” For a table, say “these columns only.” Then count the columns or headings in the reply before you use it. If you do not need a machine to parse the result, a table or locked outline is usually easier to inspect than JSON.

Before you hit send

Structure is a contract. The prompt has to state it, and you still have to check that the reply kept it.

Ship niche eBooks with agents already built.

Get the Interactive eBook Builder for $59