A CSV file stores data in rows and columns, separated by commas
A CSV file (comma-separated values) is a plain text document where each line represents a row of data, and commas mark the boundaries between columns. When you open a CSV file in a spreadsheet program like Microsoft Excel or Google Sheets, the commas disappear and the data arranges itself into a grid — the same layout you see in a database or table.
CSV is one of the oldest and most portable data formats. It has no special formatting, no formulas, no colors — just text and commas. That simplicity is why almost every program that handles data can read a CSV file: accounting software, email programs, contact managers, statistical tools, and web applications all accept CSV as an import format.
The file extension is .csv. When you download data from a website, export records from a database, or back up a contact list, CSV is often the format offered because it works everywhere.
Key Takeaways
- CSV files are plain text with data arranged in rows and columns, separated by commas, and open in any spreadsheet program or text editor.
- The format contains no formulas, colors, or special formatting — only text — which makes it compatible with nearly every software program.
- You can open a CSV file by double-clicking it (which usually opens Excel or Sheets) or by right-clicking and choosing "Open With" to pick a different program.
- When you save a spreadsheet as CSV, all formulas convert to their calculated values and formatting is lost, so keep a backup of the original file.
How to open a CSV file on Windows or Mac
The simplest way is to double-click the .csv file. Windows and Mac both associate CSV files with spreadsheet programs by default — usually Excel on Windows or Numbers on Mac — and the file opens in a grid layout immediately.
If you want to choose a different program, right-click the file (or Control-click on Mac), select "Open With", and pick from the list. Google Sheets, LibreOffice Calc, Apple Numbers, and any text editor all work. A text editor shows you the raw commas and line breaks; a spreadsheet program hides them and shows you a table instead.
On a Mac, if "Open With" does not appear, click "Get Info" instead, scroll to "Open With", and select your program there.
What happens when you open a CSV in Excel or Google Sheets
The spreadsheet program reads the commas and automatically splits the data into columns. A CSV line like John,Doe,john@example.com,555-1234 becomes four separate cells: one for the first name, one for the last name, one for the email, and one for the phone number.
If a field contains a comma itself — for example, a company name like "Smith, Jones & Associates" — the CSV format handles this by wrapping that field in quotation marks: "Smith, Jones & Associates",contact@example.com. The spreadsheet program recognizes the quotes and treats everything inside as a single cell, commas and all.
Once the data is in a spreadsheet, you can edit it, sort it, filter it, and format it the same way you would any other spreadsheet. The CSV file itself does not change until you save.
What you lose when you save a spreadsheet as CSV
CSV is plain text only, so saving a spreadsheet as CSV strips away everything that is not text. Formulas become their results — if a cell contained =A1+B1, it saves as the number that formula calculated. Colors, bold text, cell borders, and merged cells all disappear. Multiple sheets in one workbook collapse into a single sheet (you have to save each sheet as a separate CSV file).
Before you save a spreadsheet as CSV, save a copy in the original format first — .xlsx for Excel, or keep it in Google Sheets. That way you preserve the formulas and formatting if you need to edit the spreadsheet later. Use CSV only when you need to send the data to another program or share it in a format that everything can read.
When to use CSV instead of Excel or Google Sheets
Use CSV when you need to move data between different programs. If you have contacts in one email program and want to move them to another, export as CSV from the first program and import into the second. If you download data from a website or database, it often comes as CSV because that format works with any software.
CSV is also the standard for data analysis tools like Python, R, and statistical software. Researchers and analysts work with CSV files constantly because the format is simple, universal, and easy to process with code.
Do not use CSV if you need to preserve formulas, formatting, or multiple sheets. For those, keep the file in Excel (.xlsx), Google Sheets, or another spreadsheet format.
How CSV files handle special characters and line breaks
Commas separate columns, but what if your data contains a comma? The CSV format wraps that field in double quotation marks. A line like "New York, NY",10001 is read as two cells: the city and state together, and the zip code.
Line breaks inside a cell work the same way. If a cell contains text that spans multiple lines, the entire cell is wrapped in quotes: "This is line one This is line two",next_cell. The spreadsheet program recognizes the quotes and treats everything inside — including the line break — as one cell.
These rules are part of the CSV standard, so any program that reads CSV correctly handles quotes and line breaks the same way. If a spreadsheet program fails to import your CSV correctly, the file itself is usually fine — the program just needs different settings or a different import method.
CSV vs. other data formats
CSV is text-based and human-readable. You can open a CSV file in Notepad and see the actual data and commas. Excel files (.xlsx) are binary — they contain formatting, formulas, and multiple sheets, but you cannot read them in a text editor. JSON and XML are also text-based but use a different structure with tags and nesting, which makes them better for complex data but harder to read at a glance.
For simple data — contacts, sales records, survey responses, inventory lists — CSV is the fastest and most compatible choice. For data that needs formulas, colors, or multiple related sheets, use Excel or Google Sheets. For data with complex relationships or hierarchies, JSON or XML may be better, but most people never need them.
Frequently Asked Questions
Can I edit a CSV file in Notepad?
Yes. Open the file in Notepad (or any text editor) and you see the raw text with commas. You can edit the data directly, but you have to be careful not to accidentally delete a comma or add one in the wrong place. Most people find it easier to edit CSV files in a spreadsheet program where the columns are visible.
What if my CSV file does not open correctly in Excel?
Excel sometimes guesses wrong about how to split the columns. When you open a CSV file, Excel may show an import dialog where you can specify the delimiter (comma, semicolon, tab, etc.) and preview how the data will split. Choose "Comma" and check the preview before clicking OK. If the dialog does not appear, go to the Data menu and look for "Text to Columns".
Can I convert a CSV file to Excel format?
Yes. Open the CSV file in Excel, then go to File > Save As and choose "Excel Workbook (.xlsx)" from the format dropdown. The data stays the same, but now it is saved in Excel format with the ability to add formulas and formatting. Keep the original CSV file as a backup if you might need to share it with others.
Why does my CSV file open in the wrong program?
Windows and Mac associate CSV files with a default program based on what you have installed. If you want CSV files to always open in a specific program, right-click a CSV file, choose "Open With" (or "Get Info" on Mac), select your preferred program, and check the box that says "Always use this app" or "Change All". After that, double-clicking any CSV file opens it in that program.
Is CSV the same as a spreadsheet?
No. A spreadsheet is a program (like Excel or Google Sheets) and a file format (.xlsx or .ods). CSV is just a text format for storing data. You can open a CSV file in a spreadsheet program to view and edit it, but the CSV file itself has no formulas, colors, or sheets — it is just text and commas.