Skip to content
Lesson Six

Understanding
basic file types

CSV, JSON, MD and TXT: four plain-text formats carry most of the data you will ever hand to an AI. Plain text is the native format for LLMs: they learn in text, think in text, and output plain text. Knowing the plain-text formats adds a layer of clarity to working with AI.

Scroll, click, or use the arrow keys to move through.Scroll, or use the arrows and dots to move through.

Why the formats

They are all just text.

Every one of these can open in a plain text editor. The difference is the structure the content follows. These four structures turn a text file from something a person can read into something a machine can rely on.

Text with no rules

TXT

Characters and line breaks, nothing more. Good for notes, transcripts, and raw dumps. Great for stories and bad for data. With no structure to lean on, a machine reading it has to guess at the organization.

Structure: none · Best for: notes, transcripts, raw text
A TXT file
Meeting moved to Tuesday.
Ask Sean about the export.
Narrative text with structure

MD

Markdown adds human and AI readable markup to a text file: headings, lists, links, emphasis, tables and images. Still readable as plain text, but with enough structure for real documents. It is the format models read and write most fluently, and the headings give AI systems a layer of organization. It was designed to convert easily to HTML, so it also works for display.

Structure: light · Best for: documents and instructions
The raw file
# Q3 plan
- Ship the survey
- **Hire** one analyst
Rendered
Q3 plan
  • Ship the survey
  • Hire one analyst
A spreadsheet stripped to text

CSV data delivery

CSV is the text version of a spreadsheet, and a simple, easy way to pass data to an AI. Rows on lines, columns split by commas, a header row naming the columns. It is the plain-text form of a table, and every spreadsheet tool can export it.

Structure: rows and columns · Best for: tables and exports
The raw file
name,team,seats
Megan,Ads,4
Frank,Client,2
Rendered
nameteamseats
MeganAds4
FrankClient2
Data with labels and nesting

JSON: a flexible way to create nested data structures

Every value carries a name, and values nest inside values. It is the native language of most APIs: the requests and responses often travel as JSON. Reading and parsing JSON is critical to effective AI tools.

Structure: full · Best for: APIs and structured records
A JSON file
{ "name": "Megan",
  "team": "Ads",
  "seats": 4 }
Text in different shapes
1
TXT
Text with no rules. Structure: none. Best for: notes, transcripts, raw text.
2
MD
Narrative text with structure. Structure: light. Best for: documents and instructions.
3
CSV
A spreadsheet stripped to text. Structure: rows and columns. Best for: tables and exports.
4
JSON
Data with labels and nesting. Structure: full. Best for: APIs and structured records.

Same text, increasing structure. That is the whole taxonomy.

For anyone working with AI

Structure in, accuracy out.

When you hand a file to a model, the structure is context. A CSV says these are columns with these names. JSON says exactly what each value means. TXT makes the model guess, and guessing is where errors start. The more structure the file carries, the less the model has to invent.

The same fact in a more structured file is a more reliable answer.

Why not Word or Excel

It is all about efficiency.

Many AI systems can use tools to read other file formats such as XLSX or DOCX, so why not use those? Those formats are not native to AI, and processing them consumes extra processing and memory, which adds time and cost to any function. They make sense as an output for certain functions, but avoid them as input when possible.

The lesson in one line

Four formats, one rule: match the structure to the data.

Notes in TXT, documents in MD, tables in CSV, records in JSON. Get the match right and both the humans and the machines read it without guessing.