Home › Guides › What is a CSV file?
What is a CSV file?
The CSV format explained: what comma-separated values are, what a CSV file looks like, how it differs from Excel, and how to open, create and fix one.
A CSV file (comma-separated values) is a plain text file that stores a table. Each line is one row, and the values in each row are separated by commas. It has the extension .csv, and almost every spreadsheet, database and business app can open it, which is why it's the most common format for moving data from one program to another.
What a CSV file looks like
Open a CSV in a text editor and you see something like this:
name,email,city,zip
Ana Lima,[email protected],Lima,15001
"Smith, John",[email protected],Boston,02108
Open the same file in Excel or Google Sheets and it shows up as a table with four columns (name, email, city, zip) and two rows of data.
The CSV format rules
CSV is simple, but a few rules (written down in the RFC 4180 standard) make it work:
- One record per line. Each line ends with a line break.
- Values separated by commas. Every row should have the same number of values.
- An optional header row. The first line usually holds the column names.
- Quotes around tricky values. If a value contains a comma, a quote or a line break, it's wrapped in double quotes, as with
"Smith, John". A quote inside a value is doubled:"She said ""hi""". - No formatting. No fonts, colors, formulas, column widths or multiple sheets. Just text.
CSV vs Excel (XLSX)
| Feature | CSV | Excel (XLSX) |
|---|---|---|
| What it is | Plain text | A zipped workbook |
| Sheets | One table per file | Many sheets |
| Formatting and formulas | No | Yes |
| Opens in almost any program | Yes | Mostly spreadsheet apps |
| File size | Small | Larger |
More detail in XLSX vs CSV: what's the difference?
How to open a CSV file
- Excel: double-clicking works for simple files, but Excel guesses the encoding and strips leading zeros. The safe way is Data › From Text/CSV, choose 65001: Unicode (UTF-8), and set ID or ZIP columns to Text. Our guide on converting CSV to Excel properly walks through it.
- Google Sheets: File › Import › Upload, then choose how to split the columns.
- Mac: Numbers opens CSV files directly; so does Excel for Mac.
- Any text editor: Notepad, TextEdit or VS Code show the raw text.
- In your browser: drop it into our spreadsheet viewer, or turn it into a real Excel file with the CSV to Excel converter.
How to create a CSV file
- From Excel: File › Save As › CSV UTF-8 (Comma delimited). Excel saves only the sheet you're on; to save every sheet at once, use the XLSX to CSV converter.
- From Google Sheets: File › Download › Comma-separated values (.csv).
- By hand: type values separated by commas in any text editor and save the file with a .csv extension.
- From other formats: convert JSON to CSV, XML to CSV or TXT to CSV.
Common CSV problems
- Everything in one column. The separator doesn't match. Many European countries use semicolons instead of commas because the comma is their decimal mark.
- Strange characters like é. The file is UTF-8 but was opened as an older encoding. Save it as UTF-8 with BOM, or import it with UTF-8 selected.
- Lost leading zeros. Excel turns 00501 into 501 when it guesses that a column is numbers. Import the column as Text.
- Long numbers as 1.23E+15. Excel can't hold more than 15 significant digits as a number. Import those columns as Text.
Each of these is covered in fixing garbled characters, lost zeros and other CSV problems.
FAQ
Questions
What does CSV stand for?
CSV stands for comma-separated values.
What is a CSV file used for?
Moving table data between programs. Banks, online stores, CRMs, email platforms and databases export and import CSV because almost every program can read it.
How do I open a CSV file?
Double-click it to open it in Excel, Numbers or your default spreadsheet app, or open it in Google Sheets with File › Import. To keep leading zeros and accents intact in Excel, use Data › From Text/CSV instead of double-clicking. You can also open it in any text editor, or in our online viewer.
Is a CSV file the same as an Excel file?
No. A CSV is plain text with one table and no formatting. An Excel file (.xlsx) is a workbook that can hold many sheets, formatting, formulas and charts. Excel can open and save both.
How do I make a CSV file?
In Excel, choose File › Save As and pick CSV UTF-8 (Comma delimited). In Google Sheets, choose File › Download › Comma-separated values. To save every sheet of a workbook at once, use the XLSX to CSV converter.
Why does my CSV open in one column?
The file uses a different separator from the one your Excel expects, usually commas versus semicolons. Open it with Data › From Text/CSV and choose the right delimiter, or convert it with our CSV to Excel converter, which detects it.
Is a CVS file the same thing?
"CVS file" is a common typo for CSV file. They're the same thing: comma-separated values.