CSV vs Excel: what each file really contains, and what breaks in between
Half the data in the world moves as CSV and the other half as Excel files, and the join between them is where IDs lose their zeros and dates turn into March. This guide explains what each format actually holds, the specific ways opening a CSV in Excel damages it, and how to convert in either direction without the damage โ which CSV to Excel and Excel to CSV do in the browser.
What a CSV is
Comma-separated values is plain text: one record per line, fields separated by commas, fields containing commas, quotes or line breaks wrapped in double quotes with inner quotes doubled. RFC 4180 (2005) wrote that down decades after the format was in use, and dialects still vary โ Excel in most of Europe writes semicolons (because the comma is the decimal separator), tabs make a TSV, encodings differ. A CSV has no types: every field is text, and "007", "3/4" and "1E5" are just characters until a program decides otherwise. No formatting, no formulas, no multiple sheets, no colours โ which is exactly why every program on earth reads it.
What an Excel file adds
An .xlsx is a ZIP archive of XML files (Office Open XML, standardised as ECMA-376 and ISO 29500): a workbook listing sheets, a sheet file per tab with typed cells, a shared-strings table for text, styles defining number formats (including which cells are dates), formulas with cached results, plus charts, images, comments and validation. Numbers are stored as numbers, dates as day-counts since 1900 with a display format, booleans as 0/1. The structure is why an Excel file can hold a model and a CSV can hold a table. Excel to JSON reads that structure into typed records.
How Excel breaks CSVs
Open a CSV directly and Excel guesses every field's type, permanently, on save:
- Leading zeros vanish. 00742 becomes 742 โ postcodes, ZIP codes, product codes, phone numbers.
- Long numbers become scientific notation and lose digits: a 16-digit card or tracking number becomes 1.2345E+15, its last digits gone for good.
- Anything date-like becomes a date. 3/4 becomes 4 March (or 3 April); "1-2" becomes a date; the gene names SEPT2 and MARCH1 were renamed by geneticists because of this.
- Delimiters are guessed by locale, so a comma file opens as one column in a semicolon locale and vice versa.
- Encoding is guessed, so accented names arrive as รยฉ unless the file starts with a byte-order mark.
The damage is silent and saved, which is why a converter that writes a real .xlsx with text kept as text โ and numbers as numbers only where you say so โ beats the double-click.
Which to use when
- CSV for moving data between programs, importing into databases and tools, publishing datasets, and anything a script will read. Universal, diffable, small.
- Excel for people: formatting, several sheets, formulas, charts, validation, and sending a report someone will read rather than parse.
- Neither for archives that must last decades: CSV plus a data dictionary, or PDF for the report.
Converting cleanly
CSV to Excel: parse properly (quoted fields, sniffed delimiter), write numbers as numbers and everything else as text, and tick "keep everything as text" for a file full of identifiers. Excel to CSV: export the sheet you want, convert dates to ISO (2026-09-16, not 45916 or 16/09/26), take formulas by their calculated value, and choose the delimiter the destination expects. Both directions lose formatting by definition. Preview the result in the CSV viewer โ which shows the file's real contents rather than a spreadsheet's interpretation โ and What JSON is, and where it trips people up covers the third format data moves in.
Sources and further reading
The claims in this guide rest on these references, which were checked when the guide was last updated. Spotted an error? The contact page says how to report it.