DataForge

What Is a CSV File? A Plain-Language Introduction

5 min readUpdated September 2026
Rows and columns of a spreadsheet

If you have ever exported a report from a bank, an online store or a spreadsheet, you have almost certainly met CSV. It is the quiet workhorse for moving tables between programs — a plain-text format that both a person and a machine can read. Understanding its handful of rules makes importing, cleaning and sharing data far less mysterious.

A text file that describes a table

CSV stands for Comma-Separated Values. Each line of the file is one row of the table, and within a line the individual cells are separated by a delimiter — traditionally a comma. The very first line is usually the header: a list of column names such as id, name and email. Everything after it is data. Because it is plain text, a CSV file opens in any editor, weighs almost nothing, and can be produced or consumed by virtually every programming language and application.

That simplicity is exactly why CSV has survived for decades while richer formats came and went. It carries no formatting, no formulas and no colours — just the values. When you need to move raw data from one system into another, that minimalism is a feature, not a limitation.

The header row and the delimiter

Two decisions define how a CSV file reads. The first is the header: naming your columns on the first line lets any tool label the data correctly and lets you refer to columns by name rather than position. The second is the delimiter. Despite the name, the separator is not always a comma — semicolons are common in countries where the comma is a decimal mark, tabs produce a TSV file, and pipes appear in exports from older systems. A good tool detects the delimiter automatically, but knowing which one your file uses saves confusion.

Column names deserve a little care, because most tools use them verbatim. A trailing space in a header becomes part of the column name, so a lookup for "email" quietly fails against a column called "email ". Two columns sharing a name force the reader to invent a rule — pandas renames the second one to name.1 rather than dropping it, while other tools overwrite the first. Lower case with underscores travels well between spreadsheets, databases and code, and avoids the quoting that spaces and punctuation demand later.

RFC 4180: the closest thing to a standard

CSV does have a written description: RFC 4180, published in 2005. It is an informational memo rather than a mandate — it registers the text/csv media type and writes down what most producers were already doing. Records end with a CRLF pair, an optional header line has the same shape as a record, fields may be wrapped in double quotes, a quote inside a quoted field is doubled, and every record carries the same number of fields.

The practical lesson is to write files that follow it and read files that do not. Line endings that are bare LF, a missing newline at the end of the file, semicolons instead of commas, rows with a stray extra field — all of those fall outside the RFC and all of them are everywhere. One detail is telling: the media type carries an optional header parameter with the values present and absent, precisely because no parser can work it out on its own. A header line is just a line of text, and a first data row made entirely of words looks exactly the same.

What a CSV file cannot tell you

A CSV carries values, not meaning. There is no type information: 42, 2026-09-01 and 007 are equally just text, and whatever reads the file decides what they become. There is no schema, no units, no currency, no timezone, and no way to mark which column is the key. Two exports with the same columns in a different order are interchangeable only because a human read the header and noticed.

Two gaps bite most often. An empty field is ambiguous: it may mean unknown, not applicable, or a genuinely empty string, and CSV has no way to tell them apart. And because spreadsheets guess types the moment a file opens, an identifier like 00123 loses its leading zeros and a product code like 1-2 is read as a date. When identifiers matter, give those columns a text type on the way in and on the way out, and spot-check a few rows after every round trip through a spreadsheet.

Quoting: how commas live inside values

What happens when a value itself contains a comma — an address like "Tallinn, Estonia", say? The CSV convention is to wrap such a value in double quotes, so the comma inside is treated as text rather than a column boundary. If the value also contains a double quote, that quote is doubled ("") to escape it. These rules let CSV carry messy, human text safely, but they also trip up naive parsers that simply split each line on the delimiter — which is why robust parsing matters.

To see all of this in practice, paste a small CSV into the Cleaner and load it. The preview shows how the rows and columns were interpreted, and the stats report the delimiter that was detected — a quick way to confirm your file is being read the way you expect.

The takeaway

A CSV file is just a text table: one row per line, cells split by a delimiter, an optional header on top, and quotes to protect values that contain the delimiter. Master those four ideas and almost any export becomes easy to read and clean.

Related tool
DataForge · Cleaner

Open the tool and try it now