Web Analytics
Skip to content
← All writing
Engineeringen · OriginalAugust 20, 2026 · 11 min read

What Is a CSV File? A Plain-English Guide to Comma-Separated Values

What is a CSV file? A clear guide to comma-separated values, what CSV stands for, how the format works, and when to use it.

M
Mezi Aris ApronnyFounder, Nelenga · Seginim, Bengkulu Selatan
What Is a CSV File? A Plain-English Guide to Comma-Separated Values

A CSV file is a plain-text file that stores tabular data, one row per line, with each value separated by a comma. CSV stands for “comma-separated values,” and that name tells you almost everything: it is a table flattened into text a person or a program can read line by line. Open one in a text editor and you see the raw data. Open it in Excel or Google Sheets and it snaps into rows and columns.

What does CSV stand for?

CSV stands for comma-separated values. The comma is the delimiter, the character that marks where one value ends and the next begins. So the CSV file meaning is literal: a list of values, separated by commas, arranged as rows of data.

The important word is “plain text.” A CSV has no fonts, no cell colors, no formulas, and no hidden metadata. It is just characters, usually saved with a .csv extension. That is why a .csv opens the same way in Notepad, VS Code, Excel, a Python script, or a database import tool. When people ask what CSV means in practice, the short answer is: the simplest portable way to move a table between two programs that do not otherwise speak the same language.

What a CSV file actually looks like inside

Here is a small CSV with a header line and three rows of data:

name,email,city
Ari,ari@example.com,Bengkulu
Sinta,sinta@example.com,Jakarta
Budi,budi@example.com,Bandung

The first line, name,email,city, is the header. It labels each column. It is not required by the format, but almost every real CSV includes one so the columns mean something.

Each line after that is a record. Within a line, each piece between commas is a field. So row two has three fields: Ari, ari@example.com, and Bengkulu. Line breaks separate rows, commas separate fields. That is the whole model. A file with 40,000 customers is just this same pattern repeated 40,000 times.

Notice there is no table drawn anywhere. The grid you see in a spreadsheet is something the spreadsheet builds for you from these commas and line breaks. The file itself stays flat.

CSV file format rules: delimiters, quoting, and line endings

The CSV file format is loose, which is both its strength and its main source of pain. There is a rough standard (RFC 4180), but plenty of programs bend it. Three rules matter most in real work.

The delimiter is not always a comma. Comma is the default, but files exported in countries that use a comma as the decimal separator often use a semicolon instead, because 1,50 would otherwise look like two fields. You will also meet tab-separated files. If your data lands in one column when you open it, the delimiter is usually the culprit. We cover this in detail in csv delimiter explained.

Quoting protects special characters. What if a value contains a comma, like an address Jl. Merdeka, No. 12? You wrap the field in double quotes: "Jl. Merdeka, No. 12". Now the comma inside is treated as text, not a separator. If the value itself contains a double quote, you escape it by doubling it: "She said ""hi""". Quoting is also how a field can safely contain a line break.

Line endings and encoding vary by system. Windows tools often end lines with a carriage return plus line feed, while macOS and Linux use just a line feed. Most importers handle both, but some strict ones do not. Encoding matters just as much: if names with accents or non-Latin characters turn into garbled symbols, the file is almost certainly not being read as UTF-8. That specific problem gets its own walkthrough in csv encoding utf 8.

What CSV is good at, and what it deliberately leaves out

CSV is good at exactly one thing, and it does it well: moving a flat table from A to B. It is tiny, human-readable, supported by nearly every tool ever built, and easy to generate from a few lines of code. If you need to export a report, hand data to a colleague, or feed a bulk import, CSV is usually the path of least resistance.

The format leaves out everything else on purpose. A CSV cannot store:

  • More than one table (no sheets or tabs)
  • Formulas, only the resulting values
  • Data types, so 007 and 2026-01-05 are just text until something interprets them
  • Formatting, colors, or merged cells
  • Nested or hierarchical data

That last point is the real boundary. CSV is flat by design. The moment your data has lists inside records or objects inside objects, CSV starts fighting you, and a format like JSON fits better. We compare the two in csv vs json.

CSV vs spreadsheets and other data formats

A quick orientation, because “CSV” gets confused with the tools that open it.

A .csv is data. An .xlsx is a spreadsheet document. When you open a CSV in Excel, you are not editing an Excel file, you are viewing raw text through Excel’s grid. Save it back and Excel may quietly change things: strip leading zeros from a phone number, turn 1-5 into a date, or drop a second sheet you did not know it could not keep. If that surprises you, the difference is worth reading in full at csv vs excel.

TSV is the same idea with a tab as the delimiter instead of a comma, which sidesteps the “commas inside values” problem entirely. The trade-offs are small but real, and covered in tsv vs csv. JSON goes the other direction: heavier and more verbose, but able to hold nested structure that CSV cannot.

Rule of thumb: reach for CSV when the data is a single flat table and you want maximum compatibility. Reach for something else when you need multiple tables, structure, or preserved formatting.

How programs read and write CSV

Almost everything reads CSV, which is why it survives.

Excel and Google Sheets import it directly. In both, use the “import” flow rather than double-clicking when you care about the details, because that flow lets you pick the delimiter and the encoding instead of guessing.

Databases load CSV through commands like COPY in PostgreSQL or LOAD DATA INFILE in MySQL, which is how bulk imports of thousands of rows usually happen.

Code treats CSV as a first-class citizen. Python has a built-in csv module and, for larger jobs, pandas.read_csv(). JavaScript, Ruby, Go, and the rest all have well-worn CSV libraries. A few lines is enough to read a file, loop over the rows, and write a new one.

The point is that CSV is a lingua franca. A file your accounting software exports can be read by a Python script, loaded into a database, and opened in Sheets, without anyone writing a custom parser.

Common CSV problems and how to avoid them

Most CSV pain comes from a handful of predictable issues:

  • Everything lands in one column. The delimiter your file uses does not match what the program expects. Choose the delimiter explicitly on import.
  • Accented or non-Latin text looks broken. The file is UTF-8 but is being read as something else. Set the encoding to UTF-8 when you open it.
  • Leading zeros disappear. A spreadsheet read 00123 as the number 123. Import the column as text, do not let the tool auto-detect the type.
  • A value with a comma splits into two. The field was not quoted. Wrap fields containing commas in double quotes.
  • Rows misalign after one bad line. An unescaped quote or a stray line break shifted everything below it. Check the offending row in a plain text editor.

None of these are bugs in CSV. They come from the format’s looseness meeting a tool that guessed wrong. Being explicit about delimiter, encoding, and column types fixes almost all of them.

Turning a CSV into a readable table or Markdown

Raw CSV is fine for machines but hard to read at a glance, especially in a pull request, a README, or a chat message where a spreadsheet is not welcome. A Markdown table is far easier to scan.

If you want to preview a CSV as a clean table, or paste one into documentation, our CSV to Markdown converter turns comma-separated values into a formatted Markdown table. It is a quick way to check that your delimiter and columns are correct before you commit the file anywhere.

FAQ

What does CSV stand for? Comma-separated values. It describes the format exactly: rows of values, separated by commas, stored as plain text.

Can I open a CSV file without Excel? Yes. A CSV is plain text, so any text editor (Notepad, TextEdit, VS Code) opens it and shows the raw commas. Google Sheets, Numbers, and countless free viewers open it as a table. Excel is only one option, not a requirement.

Is a CSV file the same as an Excel file? No. A CSV holds only flat data as text, with no formulas, formatting, or multiple sheets. An .xlsx is a full spreadsheet document. Excel can open and save CSVs, but converting between them can lose information like leading zeros or extra sheets.

Does a CSV file have to use commas? Not always. Comma is the default and the source of the name, but many files use semicolons or tabs as the delimiter, often because the data itself contains commas. The program reading the file needs to know which delimiter was used.

#csv#data#guide