filetity

CSV vs Excel: which is smaller depends on how many rows

A CSV is a text file of rows and commas. An .xlsx is a zip archive full of XML. The usual summary is that CSV is the small, simple one and Excel is the heavy one, and that is true right up until it is not. Here is the same table written both ways on 2026-09-13:

RowsCSVXLSXXLSX vs CSV
41151,71114.9x larger
1003,3904,0351.19x larger
1,00036,96025,9520.70x, smaller
10,000399,660249,4180.62x, smaller

The crossover is around 150 rows. At 150 they are level, at 200 the spreadsheet is already 7% smaller, and by ten thousand rows it is a third smaller than the plain text version.

The reason is the zip. An .xlsx is compressed and a CSV is not, and a table is extremely repetitive: the same words, the same date, the same shape of number over and over. Compression eats that. What an .xlsx pays for it is a fixed cost of about 1.7 KB of scaffolding, which is enormous next to a four row file and irrelevant next to a real one.

The part that actually matters

Size is the least interesting difference. A CSV has no types. Every value in it is text, and the program opening it decides what each one was meant to be. Excel decides aggressively and does not ask:

An .xlsx states the type of every cell, so none of that is guessed. That is the real trade: a CSV is readable by everything and understood by nothing, and a spreadsheet file is the opposite.

Writing a CSV safely is harder than it looks

That last bullet is a security problem, not only an annoyance. A value beginning =, +, - or @ is a formula, and a CSV from an untrusted source can carry one that runs when somebody opens it. Our own CSV writer prefixes an apostrophe to those values for exactly that reason, so the phone number above is written '+44 7700 900123 and arrives as text.

Which is a strange thing to have to do: defending a plain text format against the program most likely to open it.

So which one

CSV when something else has to read it: an import, a script, a database, a system whose age you do not know. It is the only format everything agrees on.

XLSX when a person will open it, and especially when the data contains any of the four traps above. It keeps the types, holds more than one sheet, and past a few hundred rows it is the smaller file as well.

If you are handing a CSV to a colleague who will open it in Excel, you are choosing the format that will quietly change their data. Converting it first is not a nicety.

Convert or read one

These run in your browser, with nothing uploaded, and the converter states each cell's type so Excel has nothing left to guess.

More on the format itself in what is a CSV file.

filetity is built by Adarsh Mishra. Every size above came from writing the same table with this site's own CSV and XLSX writers on 2026-09-13; your data will compress differently and the shape of the curve will not. Corrections welcome: support@filetity.com.