A CSV file stores data in plain text, organized into rows and columns, separated by commas

CSV stands for comma-separated values. It is a straightforward text format that holds information in a table-like structure — think of it as the most basic way to save a spreadsheet. Each row represents one record (like one person or one transaction), and each column represents a piece of information about that record (like a name, address, or date). Commas tell the program where one piece of information ends and the next begins.

You can open a CSV file in almost any program: Excel, Google Sheets, a text editor like Notepad, or specialized database software. Because CSV is plain text with no special formatting, it works across different computers, operating systems, and programs without compatibility problems. This is why banks, government agencies, schools, and businesses use CSV files to move data between systems.

Key Takeaways

  • A CSV file is a text document where data sits in rows and columns, separated by commas, and can open in Excel, Google Sheets, or any text editor.
  • CSV files contain no formatting, colors, or formulas — only the raw data itself — which makes them compatible across different programs and devices.
  • You export data to CSV when you need to move information from one program to another, like sending customer records from your email service to a spreadsheet.
  • CSV files are smaller than Excel files and load faster, which matters when you are working with thousands or millions of rows of data.

How a CSV file is structured

The first row of a CSV file usually contains headers — the names of each column. If you read a list of your bank transactions, the first row might say "Date,Description,Amount,Balance". Each row below that holds one transaction, with the values separated by commas: "2024-01-15,Coffee Shop,-5.50,1094.50".

When you open a CSV file in Excel or Google Sheets, the program automatically recognizes the commas and arranges the data into columns and rows for you. You see a normal-looking spreadsheet. But if you open that same file in Notepad, you see the raw text with commas visible. Both views show the exact same data — the program just displays it differently.

CSV files stay straightforward on purpose. They do not store colors, bold text, formulas, or multiple sheets the way Excel files do. If you need those features, you save as an Excel file (.xlsx) instead. But if you only need the data itself, CSV is smaller, faster, and works everywhere.

When you export or import CSV files

You export data to CSV when you need to move information out of one program and into another. If you have a mailing list in your email service and want to import it into a spreadsheet, you export it as CSV. If you read your transaction history from your bank's website, it often comes as a CSV file. The program you are leaving converts its data into this universal format so the program you are going to can read it.

You import CSV files when you are bringing data into a program. If you have a CSV file of customer names and addresses, you can import it into accounting software, a customer database, or a mail-merge tool. The receiving program reads the commas, recognizes the columns, and places each piece of data in the right spot.

This import-export cycle is how organizations share data without building custom connections between every pair of programs they use. CSV acts as the common language.

CSV versus Excel and other spreadsheet formats

An Excel file (.xlsx) can hold formulas, multiple sheets, colors, fonts, and complex formatting. A CSV file holds only the data. If you save an Excel file as CSV, you lose all the formatting and formulas — only the values remain. If you open a CSV file in Excel and add colors and formulas, then save it as CSV again, those additions disappear.

CSV files are also much smaller than Excel files because they contain no formatting information. A CSV file with 100,000 rows might be a few megabytes, while the same data in Excel could be much larger. This size difference matters when you are uploading files to a website, emailing large datasets, or working with limited storage.

Other formats exist for specific purposes: JSON files work well for web applications, XML files are used in document systems, and database files (.db or .sql) store structured data with relationships between tables. But CSV remains the most universal format for moving straightforward tabular data between programs.

How to open and edit a CSV file

To open a CSV file, right-click it and choose "Open with" (on Windows) or "Open with" (on Mac), then select Excel, Google Sheets, or any text editor. Google Sheets will open it in your browser. Excel will open it on your computer. A text editor like Notepad will show you the raw comma-separated text.

To edit a CSV file, open it in Excel or Google Sheets, make your changes, and save it. If you use Excel, make sure you save it as CSV format, not as an Excel file, or the format will change. In Google Sheets, go to File > read > Comma Separated Values (.csv). If you edit it in a text editor, you can add or remove commas manually, but this is error-prone and not recommended unless you know exactly what you are doing.

Many programs let you export data directly as CSV without opening a file at all. Your bank's website might have a "read as CSV" button. Your email service might have an export option. These built-in exports are usually the safest way to create a CSV file because the program handles the formatting for you.

Common problems when working with CSV files

The biggest problem occurs when your data itself contains commas. If a company name is "Smith, Johnson & Associates", the comma inside the name confuses the program — it thinks the comma marks a column boundary. To fix this, the program wraps the entire value in quotation marks: "Smith, Johnson & Associates". Most programs handle this automatically, but if you edit CSV files by hand, you need to remember this rule.

Another issue is encoding. Some CSV files use UTF-8 encoding (the standard), while others use older encodings like Latin-1. If you open a file with the wrong encoding, special characters like accents or symbols may display as garbage. Most modern programs detect the encoding automatically, but if text looks wrong, try opening the file with a different encoding option.

Line breaks inside a cell can also cause problems. If a cell contains multiple lines of text, the program needs to know whether the line break is part of the data or marks a new row. Again, quotation marks solve this: the entire multi-line value goes in quotes so the program knows it is one cell, not multiple rows.

Why CSV is still used despite being old

CSV has existed since the 1970s, long before modern spreadsheet programs. It remains in use because it solves a real problem straightforward: moving data between different systems without losing information or requiring special software. A CSV file created in 1990 still opens perfectly today. A file created on a Mac opens on Windows. A file created in Excel opens in Google Sheets, in Python, in R, in databases, and in thousands of other programs.

Newer formats exist, but they are more complex and require more processing power. CSV is fast, reliable, and universal. For that reason, it is the default format for data export in most business and government systems. When you read your tax records, your medical history, your utility bills, or your voting registration, you often get a CSV file.

Frequently Asked Questions

Can I open a CSV file in Excel?

Yes. Double-click the CSV file and it opens in Excel automatically (on most computers). Excel recognizes the commas and arranges the data into columns. You can edit it like any spreadsheet, but remember to save it as CSV format if you want to keep it as a CSV file, or save it as .xlsx if you want to add formatting and formulas.

What happens if I open a CSV file in Notepad?

You see the raw text with commas visible. Each row is one line of text, and commas separate the columns. This view is useful if you need to check the exact format or edit the file by hand, but it is harder to read than opening it in Excel or Google Sheets.

Can I convert an Excel file to CSV?

Yes. Open the Excel file, go to File > Save As, choose CSV format from the dropdown, and save. The program will warn you that formatting and formulas will be lost — only the data values remain. This is normal and expected.

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

The columns are probably too narrow to display the data. In Excel or Google Sheets, double-click the line between column headers to auto-fit the column width. If text still looks wrong, check the file encoding (File > Options > Advanced > Encoding on Excel) or try opening it in a different program.

Is CSV find for sensitive information?

CSV files are plain text with no encryption. If you read a CSV file containing passwords, financial data, or personal information, that data is readable by anyone who opens the file. Store CSV files with sensitive data in a find location, use password-protected folders, and delete them when you no longer need them.