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

CSV stands for comma-separated values. It is the simplest way to store a table of information — like a spreadsheet — as a text file that almost any program can read. Each row is a new line, and each column is separated by a comma. That is all there is to it.

You have probably received or downloaded a CSV file without realizing it. When you export contacts from your email, download a bank statement, or pull data from a government website, the file is often a CSV. Programs like Excel, Google Sheets, and Numbers will open a CSV and display it as a spreadsheet, but underneath it is just plain text with commas as dividers.

The reason CSV files are everywhere is that they work on any device, in any program, and they do not require special software to create or read. A CSV file created on a Mac opens the same way on Windows or Linux. A file made in 1995 opens the same way today. That simplicity and compatibility is why government agencies, banks, and data services use CSV as a standard format.

Key Takeaways

  • A CSV file stores information in rows and columns, with commas marking where each column ends, and can be opened in spreadsheet programs or plain text editors.
  • CSV files are plain text, which means they work on any device and in any program without needing special software.
  • When you download data from a bank, government website, or email service, the file is often a CSV even if you do not see that name.
  • A CSV file looks like a spreadsheet when opened in Excel or Google Sheets, but it is simpler and smaller than those programs' native formats.

How a CSV file is structured

The structure of a CSV is straightforward. The first row usually contains column headers — the names of the data categories. Each row below that is one record. Commas separate the values in each column.

Here is a simple example. If you had a list of people with their ages and cities, a CSV would look like this:

Name,Age,City Sarah,34,Portland Marcus,28,Denver Keisha,41,Atlanta

When you open this in Excel or Google Sheets, it displays as a table with three columns and three data rows. The program automatically recognizes the commas as column breaks and formats it to look like a normal spreadsheet. But the file itself is just text with commas.

If a value contains a comma — for example, a business name like "Smith, Johnson & Associates" — the entire value is wrapped in quotation marks so the program knows the comma is part of the data, not a column separator. This is why CSV files have a simple rule set: they are designed to handle almost any data without breaking.

CSV versus spreadsheet files like Excel

The main difference between a CSV and an Excel file (.xlsx) or Google Sheets is complexity and file size. Excel files can contain multiple sheets, formulas, colors, fonts, and other formatting. A CSV contains only the raw data — no formatting, no formulas, no colors.

This difference matters in two ways. First, a CSV file is much smaller, which is why large datasets are often shared as CSV files. Second, a CSV is read-only in the sense that it preserves no formatting — if you add colors or formulas in Excel and save it as CSV, those disappear. The CSV keeps only the text and numbers.

If you need to share data with someone and you are not sure what program they have, CSV is the safest choice. It will open in Excel, Google Sheets, Numbers, LibreOffice, or even a plain text editor like Notepad. An Excel file requires Excel or a compatible program.

Where you encounter CSV files

Government agencies use CSV files to publish data. If you download tax records, census data, or public datasets from a government website, the file is usually a CSV. Banks and credit card companies send transaction histories as CSV files. Email services let you export your contacts as a CSV. Payroll systems generate CSV files for bulk uploads.

Any time a website or service offers to "download your data" or "export as spreadsheet," the result is almost always a CSV. This is because CSV is the universal format — the organization does not need to know what program you use or what device you have.

You might also create a CSV yourself. If you build a contact list in a spreadsheet and save it as CSV instead of Excel format, you can import it into email, a phone, or a different program. Many online tools accept CSV files as input — you can upload a CSV to a data analysis tool, a bulk email service, or a database program.

How to open and use a CSV file

Opening a CSV is simple. Double-click the file and it will open in your default spreadsheet program — usually Excel on Windows or Numbers on Mac. If you want to edit it, you can make changes just as you would in a spreadsheet, then save it. If you save it as CSV, the changes are preserved in the same format.

You can also open a CSV in a plain text editor like Notepad (Windows) or TextEdit (Mac) to see the raw comma-separated data. This is useful if you want to check the structure or if a spreadsheet program is not available. The file will look like the example above — rows of text with commas between values.

If you receive a CSV file and want to use it in a specific program — like importing contacts into your email or uploading data to a website — the program will usually have an "import" or "upload" button that accepts CSV files. You select the file, and the program reads the columns and rows and places the data where it belongs.

Common issues when working with CSV files

The most common problem is encoding. Some CSV files use a character encoding that does not match your computer's default, which can cause special characters or non-English text to display incorrectly. If you open a CSV and see strange symbols instead of letters, try opening it in a different program or changing the encoding setting.

Another issue is delimiter confusion. In some countries, a semicolon or tab is used instead of a comma to separate columns. If you open a CSV file and all the data appears in a single column, the program may have misidentified the delimiter. Most spreadsheet programs have an option to specify which character separates the columns — you can usually fix this by choosing the correct delimiter when you open the file.

A third issue is line breaks within values. If a cell contains text that spans multiple lines, the CSV format handles it by wrapping that value in quotation marks. Some programs do not handle this correctly, which can cause the data to misalign. This is rare, but it is worth knowing if your data looks jumbled after import.

Why CSV is still the standard

Despite being created in the 1970s, CSV remains the most widely used data format because it solves a real problem: how to move data between different programs without losing information or requiring special software. It is not fancy, but it works everywhere.

Modern alternatives exist — JSON and XML are more flexible, and cloud-based tools like Google Sheets eliminate the need to download files at all. But CSV persists because it is simple, reliable, and requires nothing more than a text editor to create or read. Government agencies, in particular, continue to use CSV because it is accessible to anyone, regardless of what software they own.

Frequently Asked Questions

Can I edit a CSV file in Excel or Google Sheets?

Yes. Open the CSV file in either program, make your changes, and save it. If you save it as CSV, the format stays the same. If you save it as an Excel file (.xlsx) or Google Sheets format, it converts to that format instead.

What happens if my data contains a comma?

The CSV format handles this by wrapping the entire value in quotation marks. For example, if a company name is "Smith, Johnson & Co," the CSV stores it as "Smith, Johnson & Co" so the program knows the comma is part of the data, not a column separator.

Is a CSV file secure?

A CSV file itself is just text and is not inherently more or less secure than other file types. However, CSV files often contain sensitive data like contact lists or financial records. Treat a CSV file the same way you would treat any file with personal information — store it securely and do not share it with untrusted sources.

Can I open a CSV file on my phone?

Yes, but it depends on your phone and what app you use. Most phones have a spreadsheet app (like Google Sheets on Android or Numbers on iPhone) that can open CSV files. You can also email the CSV to yourself and open it from your email app, or use a file manager to navigate to the file and open it with a spreadsheet app.

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

The most common cause is that the program did not recognize the delimiter — the character that separates columns. When you open the file, look for an option to specify the delimiter (usually a comma, but sometimes a semicolon or tab). Selecting the correct delimiter will fix the alignment.