Guides / Files and data guides
What Is a CSV File?
A CSV file is a plain text file that stores a table: each line is one row, and the values in a row are separated by commas. It is the simplest common way to move data between programs, and you can turn one into a structured file with CSV to JSON or into a spreadsheet with CSV to Excel. Both conversions run in your browser, so the file stays on your device.
What CSV stands for
CSV stands for comma-separated values. The name describes the whole idea. Take a table with rows and columns, write each row on its own line, and put a comma between the cells. There are no fonts, colours, formulas or sheets, just text.
Here is a small example you could save as a file called customers.csv:
name,city,orders Amira Khan,Leeds,12 Tom Baker,Bristol,3 Lucia Rossi,Cardiff,27
The first line is the header row. It names the columns. Every line after it is a record. A spreadsheet program shows this as a neat grid with three columns and three data rows, but underneath it is only characters and line breaks. You can open it in Notepad or any other text editor and read it directly.
Why people use CSV files
CSV survives because it is small, easy to produce and easy to read. Almost every program that handles tables can export to it or import from it, so it works as a common language between systems that otherwise have nothing in common.
- Exports from online services. Banks, shops, survey tools, email platforms and analytics dashboards usually offer a CSV download of your data.
- Importing into other software. Contact lists, product catalogues and user accounts are often loaded into a new system from a CSV file.
- Data analysis. Analysts and programmers use CSV as a plain starting point for spreadsheets, databases and scripts.
- Small file size. With no formatting to store, a CSV is usually much lighter than the same data saved as a workbook.
How a CSV file is built
A CSV file follows a few simple rules, and most problems come from files that bend them.
Rows and fields
Each line break ends a row. Within a row, each separator ends a field, which is one cell of the table. Every row should have the same number of fields as the header. If a row has fewer, the missing cells are empty. If it has more, the extra values have no column name to belong to.
Quotes
What if a value contains a comma, such as an address? The usual answer is to wrap the value in double quotes:
name,address Amira Khan,"12 High Street, Leeds"
The quotes tell the reader that the comma inside is part of the value, not a separator. If the value itself contains a double quote, it is written twice: "She said ""hello""". Quoted values may even contain line breaks, which means a single record can span more than one line of the file. Simple tools that split text on every line break or comma fall over on these, which is why a proper parser matters.
The header row
Most CSV files start with a row of column names, but the format does not require it. Some files have no header at all. When you convert a file, you need to say whether the first row is a header, because it decides whether each record becomes a named object or a plain list of values.
Is there an official standard?
There is a document, RFC 4180, that describes the common form of CSV, but it is informational and many programs do not follow it exactly. In practice CSV is a loose convention, so files from different sources can differ in small ways. The next section covers the differences that matter most.
Common CSV pitfalls
Because CSV is so loose, the same file can look right in one program and wrong in another. These are the problems people meet most often.
Different separators
Despite the name, not every CSV uses commas. In many European countries the comma is the decimal mark, as in 3,50, so spreadsheet programs there write semicolons between fields instead. Other files use tabs or the pipe character. If you open a file and see every row crammed into one column, the separator is the cause. You can read more about the tab version in our guide to converting CSV to TSV.
Lost leading zeros and mangled codes
CSV has no way to say that a column is text. When Excel opens a file, it guesses. A postcode, phone number or product code such as 00123 can lose its leading zeros because it looks like a number. A long ID number can be turned into scientific notation, and something like 3-4 can be turned into a date. Once the file is saved again, the damage is permanent. The safest approach is to keep such columns as text on import, or to use a converter that preserves them. The CSV to Excel tool keeps values with leading zeros and numbers longer than 15 digits as text for exactly this reason.
Character encoding
A CSV file is only text, but text can be stored in different encodings. Most modern files use UTF-8, which handles accents and every alphabet. Older files, especially those from Windows software, may use Windows-1252. Open a UTF-8 file as Windows-1252 and a name like Zoƫ can appear as strange symbols. If you see this, choose the encoding explicitly when importing the file.
Dates and numbers
A date written as 03/04/2026 can mean 3 April or 4 March depending on the reader’s settings. Numbers might use a comma or a full stop as the decimal mark. Files that use the year first, such as 2026-04-03, avoid the confusion, and that is the form the converters on this site recognise as a date.
CSV compared with Excel and JSON
CSV is not the only way to store data, and it helps to know where it fits.
| Format | Best for | Limits |
|---|---|---|
| CSV | Flat tables, exports, imports, small files | No types, no formatting, no sheets, one table per file |
| Excel (.xlsx) | Working with data by hand, formulas, several sheets, formatting | Larger files, needs a spreadsheet program |
| JSON | Nested data, web services, apps | Harder for people to read as a table |
If you want a longer comparison, read CSV vs Excel vs JSON: which data format. The short version is that CSV is best for simple tables that need to travel between programs, Excel is best for people who work with the numbers, and JSON is best when the data has layers, such as an order with several items inside it.
How to open and read a CSV file
You have three sensible choices.
- Open it in a text editor to see exactly what the file contains. This is the best way to check the separator, the header and any odd characters.
- Open it in a spreadsheet program. Double-clicking usually works, but if the columns or characters look wrong, use the program’s import or text import option instead, where you can choose the separator, encoding and column types.
- Convert it to a format that suits your job, such as a workbook or JSON.
Editing a CSV in a spreadsheet and saving it again is fine for simple data, but remember that saving can change values, as described above. If the data matters, keep a copy of the original file.
How to convert a CSV file
CSV to Excel
If you want a normal workbook, use CSV to Excel:
- Paste your CSV or choose the file.
- Leave the separator on automatic, or pick one yourself, and name the sheet.
- Choose whether the first row is a header and whether numbers and dates should be converted.
- Download the .xlsx file.
The result is a single sheet. Plain numbers and dates written as YYYY-MM-DD become real Excel values, the header row can be bold and stay visible as you scroll, and values with leading zeros stay as text. There are no formulas or charts. Our guide to converting CSV to Excel and back goes through the whole process.
CSV to JSON
If a developer, a website or an app needs your data, use CSV to JSON. With a header row, each line becomes an object whose keys are the column names. Without one, each line becomes a list. Quoted values and line breaks inside quotes are handled correctly, and you can switch number detection off to keep every value as text. The step-by-step version is in how to convert CSV to JSON.
Both tools run in your browser, so the contents of the file are not sent to a server. That matters for customer lists, financial exports and anything else you would not want to upload to a stranger’s site.
Tips for creating a clean CSV file
- Use one header row with short, unique column names and no blank headers.
- Keep every row to the same number of fields.
- Save as UTF-8 so accents and other alphabets survive.
- Write dates as year, month, day, for example 2026-10-29.
- Do not use thousands separators in numbers. Write 1250, not 1,250, unless the value is in quotes.
- Avoid merged cells, notes and decorative rows above the header. CSV has no way to represent them and they confuse other programs.
- Wrap any value containing a comma, quote or line break in double quotes.
Frequently asked questions
What does CSV stand for?
CSV stands for comma-separated values. It is a plain text format where each line is one row of a table and a separator, usually a comma, divides the values in that row.
How do I open a CSV file?
Double-click it to open it in a spreadsheet program such as Excel, LibreOffice Calc or Numbers, or open it in any text editor to see the raw text. If the columns do not line up in a spreadsheet, the file probably uses a different separator, such as a semicolon.
Is a CSV file the same as an Excel file?
No. A CSV file holds plain text values only. An Excel .xlsx file can also hold several sheets, formulas, formatting, charts and real number and date types. You can turn a CSV into a proper workbook with the CSV to Excel tool.
Why do my leading zeros disappear in Excel?
When Excel opens a CSV it guesses each column type, and a value such as 00123 looks like the number 123, so the zeros are dropped. Importing the column as text, or converting the file with a tool that keeps such values as text, avoids the loss.
Why does my CSV show strange characters instead of accents?
The file is probably saved as UTF-8 but opened as an older encoding, or the other way round. Choosing the encoding when you open or import the file, or saving it as UTF-8, normally fixes it.
Can a CSV file contain commas inside a value?
Yes, as long as that value is wrapped in double quotes, for example “London, UK”. A double quote inside a quoted value is written as two double quotes. Without the quotes, the comma starts a new column.
Is it safe to convert a CSV with personal data online?
It is safer when the conversion runs in your browser and the file is never uploaded, which is how the converters on this site work. Even so, treat files with personal data carefully and delete copies you no longer need.