CSV files: the format with no types, no encoding and no committee
What a CSV really is, why the same file opens differently in two spreadsheets, and what the quoting rules actually say. Convert CSV in your browser, no upload.
At a glance
- Type
- Documents
- Extensions
- .csv
- MIME type
- text/csv
A .csv file is a text file. There is no header, no version, no type information and nothing binary — open one in Notepad and you see every byte of it. Each line is a row, and something separates the fields. That is the entire format, which is why everything can write one and why no two programs agree about what one means.
Read more
It went twenty-five years without a specification. RFC 4180 arrived in 2005 and is explicitly Informational rather than a standard — it describes what most implementations do rather than telling anyone what to do. What it does settle is the quoting: a field containing the separator, a quote or a line break is wrapped in double quotes, and a quote inside such a field is written twice. That rule is the difference between "Widget, large" being one cell and being two, and it is the rule naive parsers skip.
The separator is not reliably a comma. A spreadsheet running in a locale that writes decimals as 1,5 cannot also use the comma to separate fields, so Excel exports semicolons there — on the same machine, from the same menu, producing a file the neighbouring country cannot open. Database exports often use tabs. Any tool that reads CSV well guesses from the first few lines, which is what this site does too.
There is also no encoding declaration, and this is where the data actually gets lost. A CSV of Chinese names saved by one program and opened by another comes back as mojibake because one assumed UTF-8 and the other the system code page. And because every field is text with no type, a spreadsheet re-guesses on import: leading zeros disappear from part numbers, long identifiers turn into scientific notation, and anything that looks like a date becomes one. The file was fine; the reading of it was not.
Convert CSV to other formats
FAQ
Is a CSV just a text file?
Yes, entirely. No container, no compression, nothing binary. Any text editor opens it, and what you see is what it holds.
Why does my CSV use semicolons?
Because it was exported in a locale where the comma is the decimal separator, so the comma could not also separate fields. It is still a CSV, and any reader worth using detects the separator rather than assuming.
Why did my leading zeros disappear?
Because CSV stores no types and the spreadsheet guessed. "007" looks like a number, so it became 7. Nothing was wrong with the file — the import decided. Most spreadsheets let you set a column to text during import, which is the only reliable fix.
Why is my Chinese text garbled?
Because the file carries no statement of its encoding and the program opening it guessed differently from the program that wrote it. Saving as UTF-8 with a byte-order mark is what makes Excel read it correctly, at the cost of a marker some other tools show as stray characters.
Can I convert a CSV to PDF here?
Yes. It is parsed as CSV rather than split on commas, so quoted fields survive, and the columns are sized to their contents with the header row in bold. What you get is for reading and printing — nothing in a PDF can be sorted or summed.
What about converting to Excel?
Not needed: every spreadsheet application opens a CSV directly, and converting first only adds a step where the types get guessed. The conversion that does exist here is the other direction — PDF to Excel, which rebuilds a table out of a page that never recorded one.