Which tool to choose
Three formats for three different purposes, and the choice depends on where the output ends up. Markdown (a way of formatting text with simple symbols for headings, bold, lists) is for readable documents, notes, web pages: you use it when a person reads the result. CSV (comma-separated values) is for tables to open in a spreadsheet. JSON (a structure of name-value pairs) is for when the data is received by another application or an automation tool. Choose the format based on the recipient: human eyes, a spreadsheet, or another program.
How to do it
- Name the format and forbid the surroundings. The AI's typical error is to frame the output with sentences and explanations. For JSON, the operational syntax:
Return the answer exclusively as valid JSON.
No text before or after, no explanation, no code block with the three backticks.
Use these fields: "name" (text), "age" (number), "active" (true/false).
If a value is not available, use null, don't invent it.
- For CSV, set the headers and the separator. Ask for the first row with the column names, the values separated by commas, and to enclose in quotation marks the text that contains commas (otherwise they break the columns).
- For Markdown, indicate the elements. "Use a main heading, subheadings for each section, bullet points for the lists, and a table for the comparisons": this way you get an already-formatted document.
- Give the structure, not just the format. For JSON and CSV, list the exact fields and their type (text, number, true/false). Without structure, the AI invents the field names and they change with every request.
- Verify that the format is valid. A JSON with one comma too many won't open. Paste the output into a free online validator (search for "JSON validator") before using it in a program.
A concrete example
You have to upload a list of products into an application that accepts only JSON. You have the information scattered in a document. You pass it to the AI: "Convert these products into a JSON array. Each product with the fields: 'name' (text), 'price' (number without currency symbol), 'available' (true/false). Only valid JSON, no surrounding text, no code block." You get the clean list, you pass it through the validator to be safe, and you upload it into the application without errors. The same request in loose language would have given you a nice descriptive text, useless to import. The precise format is what makes the output something machines know how to read.
When it does NOT work (and how to fix it)
If the AI wraps the output in a code block or in sentences
It often happens that it puts the three backticks or a "Here is the requested JSON:". Fix: explicitly ask for "no code block, no introductory text, only the raw content". If it persists, copy only the format part by hand and discard the surroundings.
If the JSON or CSV turns out invalid
A wrong quotation mark or one comma too many is enough to break it. Fix: paste the output into an online validator and, if it flags an error, report it back to the AI ("this JSON gives an error on line 4, fix it") instead of fixing it by hand blindly.
If special characters or accents break
Apostrophes, accents, and curly quotation marks sometimes create problems in the import. Fix: ask the AI to use straight quotation marks and, for CSV, to enclose the text fields in quotation marks. For data with many accents, check a sample after the import.
A tip from someone who really uses it
The sentence that changes everything is "only the format, no text before or after". The AI is trained to be friendly and to explain, and that polite surrounding is exactly what causes an automatic import to error out. Put it in every request for structured output, and for JSON and CSV always pass the result through a validator before feeding it to another program: ten seconds of checking avoids the cryptic error that would make you lose half an hour looking for it.
Frequently asked questions
What is the practical difference between the three formats?
Markdown is for documents a person reads: nice to look at, formatted. CSV is for tables to open in Excel or Sheets. JSON is for data that passes to another program or an automation. The rule: if a human reads it, Markdown; if it goes into a sheet, CSV; if it goes into software, JSON.
Do I need to know programming to use JSON?
No to obtain it, a little yes to understand it. You can ask the AI for the JSON and use it where needed without programming. It helps to know that it's made of name-value pairs in curly braces, so you recognize if it's well formed. For the rest, the online validator tells you if it's valid without you having to read it.
Why does the AI sometimes produce a format declared valid but that doesn't work?
Because the AI generates the format by imitating its appearance, not by executing it: it can write a JSON that looks right but has a hidden syntax error. It doesn't "know" if it's valid until something tries to open it. That's why the validator isn't an excess of zeal: it's the way to discover the error before the program you give the output to discovers it, with a much less clear message.