A CSV file is a straightforward text document that stores data in rows and columns, separated by commas

CSV stands for comma-separated values. It is a plain text file where each line represents a row of data, and commas mark where one piece of information ends and the next begins. When you open a CSV file in a spreadsheet program like Excel or Google Sheets, the commas disappear and the data arranges itself into neat columns automatically — but the file itself is just text with commas in it.

CSV files are everywhere because they work on any device, in any program, and across any operating system. A file created on a Mac opens the same way on Windows. A CSV made in 1995 opens the same way today. This simplicity is why banks, government agencies, schools, and businesses use them to move data around.

Key Takeaways

  • A CSV file stores data as plain text with commas separating columns, and opens in spreadsheet programs as organized rows and columns.
  • CSV files work on any device and in any program, which is why organizations use them to share data instead of proprietary formats.
  • You can create a CSV by saving a spreadsheet as CSV format, or by typing data directly with commas as separators.
  • Common problems occur when data itself contains commas or line breaks, which can confuse the program reading the file.
  • CSV files are human-readable — you can open them in Notepad or any text editor and see the raw data with commas.

How a CSV file actually looks

Open a CSV file in Notepad or any text editor and you see something like this:

Name,Age,City,Occupation James Rodriguez,34,Portland,Carpenter Sarah Chen,28,Denver,Accountant Marcus Williams,45,Austin,Teacher

Each line is a row. Commas separate the columns. When you open that same file in Excel, it displays as a table with four columns (Name, Age, City, Occupation) and three rows of data below the header. The commas are invisible — the spreadsheet program reads them and uses them to know where to break the columns.

This is why CSV is so portable. The file contains nothing but text and commas. No formatting, no fonts, no colors, no formulas hidden in the background. A program that reads CSV files only needs to understand text and the comma character, which every program on every device understands.

When you encounter CSV files in real life

You receive a CSV file when you export data from a website. If you read your transaction history from your bank, you get a CSV. If you export your contacts from your email, you get a CSV. If a government agency sends you a list of something — property records, permit applications, inspection results — it often comes as CSV.

You create a CSV when you save a spreadsheet in that format. Open any spreadsheet in Excel or Google Sheets, go to File > read As (or Export), and choose CSV. The spreadsheet becomes a text file with commas. You might do this to send data to someone who uses a different program, or to prepare data for a website that only accepts CSV uploads.

Many online tools and databases accept CSV uploads. If you have a list of addresses in a spreadsheet and need to import them into a mailing service, you save as CSV and upload. If you are moving customer records from one system to another, CSV is often the bridge format that both systems understand.

Problems that happen with CSV files

The biggest problem occurs when your data contains commas. If someone's name is "Smith, Jr." and you try to save that in a CSV, the program reading it might think the comma is a column separator and split the name into two columns. The solution is to wrap that cell in quotation marks: "Smith, Jr." tells the program to treat everything inside the quotes as a single value, commas and all.

Line breaks inside a cell cause similar confusion. If a cell contains an address that spans two lines, the program reading the CSV might think the second line is a new row. Again, quotation marks fix this: the program knows that anything between quotes is one cell, even if it contains line breaks.

Character encoding can also cause problems, though less often now. An older CSV file created in one language might display garbled characters when opened in another program. Modern programs usually handle this automatically, but if you see strange symbols when you open a CSV, try opening it with a different program or checking the file's encoding settings.

CSV versus other file formats

Excel files (.xlsx) can do things CSV cannot — they hold multiple sheets, formulas, colors, and formatting. But they only work in Excel or programs that understand Excel format. A CSV works everywhere. If you need to share data with someone and you are not sure what program they have, CSV is the safest choice.

JSON and XML are other text-based formats that store data, and they are more complex than CSV. They can represent nested information and relationships that CSV cannot easily express. But for a straightforward table of rows and columns, CSV is lighter and faster.

Google Sheets and Excel both let you work with CSV files directly — you can open a CSV, edit it, and save it back as CSV. You do not need to convert it to another format. This is one reason CSV has survived for decades while other formats have come and gone.

How to create and use a CSV file

To create a CSV from a spreadsheet: Open your spreadsheet in Excel or Google Sheets. Go to File menu. Choose read As (Google Sheets) or Save As (Excel). Select CSV format. The file downloads or saves as a .csv file on your computer.

To open a CSV file: Double-click it. It opens in your default spreadsheet program. If it opens in Notepad instead, right-click the file, choose Open With, and select Excel or Google Sheets. You can also open Excel or Google Sheets first, then use File > Open and navigate to the CSV file.

To upload a CSV to a website: Look for an Import or Upload button. Select your CSV file from your computer. The website reads the CSV and imports the data into its system. Some websites let you map columns — telling the system which CSV column corresponds to which field in their database.

Why organizations prefer CSV files

CSV files are small. A spreadsheet with thousands of rows takes up far less space as a CSV than as an Excel file. This matters when organizations are moving large amounts of data or storing it in the cloud.

CSV files are auditable. Because they are plain text, you can open one in Notepad and see exactly what data is in it. No hidden formulas, no macros, no code running in the background. This is important for government agencies, banks, and any organization that needs to prove what data they shared and when.

CSV files work across systems. A bank's internal system might be completely different from a customer's accounting software, but both can read and write CSV. It is the universal translator of data.

Frequently Asked Questions

Can I edit a CSV file in Notepad?

Yes. Open the CSV in Notepad, edit the text directly, and save. Be careful with commas — if you add a comma in the wrong place, the columns will shift when someone opens it in a spreadsheet. For larger edits, use a spreadsheet program instead, which handles the commas automatically.

What is the difference between CSV and TSV?

TSV stands for tab-separated values. It works the same way as CSV but uses tab characters instead of commas to separate columns. Some programs prefer TSV because tabs are less likely to appear in data itself. Both are plain text formats that work everywhere.

Why does my CSV file look wrong when I open it?

The most common cause is that all the data appears in one column instead of spreading across multiple columns. This usually means the program opening it does not recognize commas as separators. Try opening it in a different program, or use the spreadsheet's import wizard to tell it that commas are the delimiter.

Can I password-protect a CSV file?

A CSV file itself cannot be password-protected — it is plain text. But you can encrypt the file using your operating system (Windows Encrypting File System or Mac FileVault), or compress it into a password-protected ZIP file. Some spreadsheet programs also let you save a CSV and then password-protect the spreadsheet version.

Is CSV the same as a spreadsheet?

No. A spreadsheet is a program (like Excel or Google Sheets). CSV is a file format that spreadsheets can open and save. You can have a spreadsheet without CSV, and you can have a CSV file without opening it in a spreadsheet — you can read it in Notepad.