Skip to content

What a CSV file is and how it stores data

Last checked November 14, 2026

A CSV file is a plain text file that holds a table. Each line is one record, such as one customer or one invoice. Commas separate the fields on that line. CSV stands for comma-separated values.

That's the whole idea. You can open one in a text editor and read it.1

What's inside the file

The first line usually holds the column names. Every line after it holds one record, with its values in the same order as the names. A tiny file might open with name,email,city. The next line could read Ana Ruiz,ana@example.com,Tucson, and the one after it holds the next person.

The Library of Congress describes the format as one where fields are separated by the comma character, with records on separate lines.2 Spreadsheet programs show that same file as a grid. The grid is only a view. The file itself is just text.

Why every system offers it

CSV is supported by almost all spreadsheets and database management systems.1 That's the reason it works as a common exit door. Your old system doesn't need to know anything about the new one. It only has to write plain text that the other side can read.

So when a guide on switching software says "export a CSV," it's pointing at a format that nearly any two programs can pass between them. They don't need anything else in common.

What a CSV file doesn't store

A CSV file holds values, not rules. The Library of Congress notes that the format does not support strong data typing.2 Nothing in the file says that a column is a date, a phone number or an amount of money. It's all text until a program decides otherwise.

That's why dates and numbers cause so much trouble. The fixes are on the page about date and number formats.

The format is also limited to representing a simple tabular structure.2 So a plain table can't hold attached files or formatting. If your old system stores invoices that point to customers, those links may not survive either. Check what each export includes before you rely on it. The export checklist covers this.

Commas inside values

A value can contain a comma. An address like "Main Street, Suite Four" is a common case. The rule is to wrap such a field in double quotes. Fields containing line breaks, double quotes and commas should be enclosed in double quotes.3

Because of that rule, you can't safely split a line on every comma. A program has to read the quotes too. If you ever edit a CSV by hand in a text editor, leave the quotes exactly where they are. Break one, and a single record can spill into the wrong columns.

Different files, same name

There isn't one master specification for CSV. The RFC that documents the format says that, due to lack of a single specification, there are considerable differences among implementations.3 In practice, two programs can both write "CSV" and still disagree on small things.

Here are the differences that come up most:

  • The separator. In places where the comma is the decimal point in numbers, the field separator is often a semicolon.2
  • Quotes. The format allows a field to be wrapped in double quotes or not, so programs differ.3
  • Character encoding. This decides how accents and symbols are stored.

When an import looks wrong, one of these is a likely cause. Cleaning a CSV before you import it shows how to look for each.

How a CSV file is laid outHeader line names each columnEach later line is one recordCommas separate the fieldsQuotes wrap tricky fields
One header line, then one record per line.

Reading your own export

Open the file in a plain text editor first, not only in a spreadsheet. You'll see exactly what the old system wrote. Check the header line. Count the fields on a few lines. Look for quotes around values that hold commas.

Then you can move on to field mapping, where you tell the new system which column goes where.

Notes and sources

  1. Comma-separated values, Wikipedia
  2. CSV, Comma Separated Values (RFC 4180), Library of Congress
  3. RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files, RFC Editor