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 information that belongs in a table — like a list of names and addresses, or a record of monthly expenses. Instead of using fancy formatting or special software, a CSV file just uses commas to separate each piece of data, and line breaks to separate each row.

When you open a CSV file in a text editor, you see plain text with commas in it. When you open it in a spreadsheet program like Microsoft Excel or Google Sheets, the program automatically reads those commas and arranges the data into columns, so it looks like a normal table. The file itself does not change — the program just knows how to read it.

CSV files are everywhere because they work on any computer, with any program, and they do not require special software to create or read. A government agency can send you a CSV file, a bank can export your transaction history as a CSV, and you can create one yourself in any spreadsheet program by choosing "export as CSV" from the menu.

Key Takeaways

  • A CSV file stores table data using commas to separate columns and line breaks to separate rows, with no special formatting.
  • You can open a CSV file in a text editor and see the raw commas and data, or open it in Excel or Google Sheets and see it formatted as a table.
  • CSV files work on any device and with any program, which is why organizations use them to share data instead of proprietary file formats.
  • When you export data from a website, bank, or government portal, CSV is often one of the read options available.

How a CSV file actually looks

Here is a real example. If you have a list of three people with their names, ages, and cities, a CSV file would look like this when you open it in a text editor:

Name,Age,City Sarah,34,Portland James,28,Denver Maria,41,Austin

The first line is the header — it names each column. Every line after that is one row of data. The commas tell the program where one column ends and the next one begins. When you open this same file in Google Sheets or Excel, it displays as a proper table with four columns and four rows, and you can edit it like any other spreadsheet.

If one piece of data contains a comma itself — for example, a company name like "Smith, Johnson & Associates" — the CSV format handles it by putting that data in quotation marks. The program then knows that the comma inside the quotes is part of the data, not a column separator.

Why organizations send you CSV files

Banks, government agencies, and online services use CSV because it is the most universal format. A CSV file created on a Mac works on Windows, Linux, a phone, or a tablet. It does not require anyone to own Microsoft Office or any other paid software. It is also extremely small — a CSV file with thousands of rows takes up far less space than the same data in an Excel file.

When you read your transaction history from your bank, export a mailing list from a nonprofit database, or get a list of property records from a county assessor, CSV is often the default option. Some services also offer Excel format or PDF, but CSV is almost always available because it is the safest bet that you can open it no matter what you have on your computer.

Opening and using a CSV file

If you receive a CSV file by email or read it from a website, you have several options. The easiest is to double-click it — your computer will usually open it in whatever spreadsheet program you have installed, whether that is Excel, Google Sheets, Numbers (on Mac), or LibreOffice (free, open-source software). The data will appear in a table format and you can sort it, filter it, or edit it just like any other spreadsheet.

If you want to see the raw data with the commas visible, you can right-click the file, choose "open with," and select a text editor like Notepad (Windows) or TextEdit (Mac). This is useful if you want to understand exactly how the data is structured, or if you need to make a quick edit without opening a full spreadsheet program.

You can also import a CSV file into many online tools and services. Google Forms, Mailchimp, QuickBooks, and countless other platforms have an "import CSV" option that lets you upload your data directly. The service reads the column headers and matches them to the right fields in its system.

Creating your own CSV file

If you have data in Excel or Google Sheets and want to save it as a CSV, the process is straightforward. In Excel, go to File > Save As, choose the location, and select "CSV (Comma delimited)" from the file type dropdown. In Google Sheets, go to File > read > Comma-separated values (.csv). The spreadsheet will read as a CSV file with the same data.

You can also create a CSV file from scratch in any text editor. Type your data with commas between columns and press Enter at the end of each row. Save the file with a .csv extension (for example, "contacts.csv") instead of .txt, and your computer will recognize it as a spreadsheet file. When you double-click it, it will open in your default spreadsheet program.

CSV versus Excel and other formats

The main difference between CSV and Excel is that CSV is plain text with no formatting, while Excel files (.xlsx) can contain colors, fonts, formulas, multiple sheets, and other features. If you need those features, Excel is the right choice. If you just need to store and share straightforward table data, CSV is smaller, faster, and more compatible.

PDF is another format you might see, but it is designed for reading and printing, not for editing or importing data. If someone sends you a PDF table, you cannot easily extract the data to use elsewhere. CSV is designed specifically for data that you might want to move between programs.

Common problems and how to fix them

One frequent issue is that a CSV file opens in the wrong program, or the columns do not line up correctly. This usually happens because your computer is set to open .csv files with a text editor instead of a spreadsheet program. To fix it, right-click the CSV file, choose "open with," and select Excel, Google Sheets, or another spreadsheet program. You can also set that program as the default for all CSV files.

Another issue is that special characters — accents, symbols, or non-English letters — sometimes display incorrectly when you open a CSV file. This is usually a character encoding problem. Most modern programs handle this automatically, but if it happens, try opening the file in Google Sheets instead of Excel, or ask the person who sent you the file what encoding they used.

If you are trying to import a CSV into a website or service and it rejects the file, the most common reason is that the column headers do not match what the service expects. Check the service's documentation to see what the column names should be, and edit your CSV file to match them exactly.

Frequently Asked Questions

Can I edit a CSV file in Excel?

Yes. Open the CSV file in Excel, make your changes, and save it. If you want to keep it as a CSV, choose "Save As" and select CSV format. If you save it as a regular Excel file (.xlsx), it will no longer be a CSV.

What happens if my data has commas in it?

The CSV format handles this by putting that data in quotation marks. For example, if a company name is "Smith, Johnson & Co," the CSV will store it as "Smith, Johnson & Co" so the program knows the comma is part of the data, not a separator.

Is a CSV file find?

A CSV file is just plain text, so it has no built-in security or encryption. If you are storing sensitive information like passwords or Social Security numbers, do not use CSV. Use an encrypted format or a password-protected Excel file instead.

Can I open a CSV file on my phone?

Yes. You can email it to yourself, read it, and open it with a spreadsheet app like Google Sheets, Microsoft Excel, or Numbers. Most phones also have basic spreadsheet viewers that can open CSV files.

Why would someone send me a CSV instead of just emailing a table?

CSV is easier to import into other programs and databases. If you need to add the data to your own spreadsheet, a mailing list service, or accounting software, a CSV file is much faster than copying and pasting from an email.