CSV or XLSX: which file to use for an export, with real file sizes

5 min read

Stacks of old paper files piled on a dark shelf

Use an .xlsx file when a person will open the table in Excel and the values must stay as they are, provided the .xlsx is not made by letting Excel read a CSV first (see “Converting through Excel keeps the damage” below). Use a .csv file when a program will read the table, when the file has to open on any computer, or when it holds more rows than a sheet can take. Both files can carry the same table. They differ in what they store.

What each file stores

CSVXLSX
What it isPlain text, one line per row, values separated by a characterA zip archive of XML files
Data typesNone. Every value is text until a program guessesEach cell has a type: number, text, date, formula
Several sheetsNo, one table per fileYes
Formulas and formattingNoYes
Separator and encodingNot stated by the formatFixed by the format
Opens inAlmost any editor, spreadsheet or database importExcel and the programs that read the format

Most of the trouble with CSV comes from the missing data types. The document that describes the format, RFC 4180 (October 2005, status Informational), covers lines, quoting and an optional header. It says nothing about data types, and it leaves the character set to an optional parameter. So when Excel opens a CSV, it has to guess whether 02134 is a number or a zip code, and it guesses number. Those guesses turn long IDs into E+18 and codes into dates.

An .xlsx file is a zip archive of XML files, in the Office Open XML format that Ecma International publishes as ECMA-376.

Converting through Excel keeps the damage

One way to make an .xlsx is to open the CSV in Excel and choose Save As. The conversion does not repair anything. It stores what Excel understood when it read the CSV.

We opened a file with two zip codes, 02134 and 00501, and saved it as .xlsx. When we opened the .xlsx, the zip codes were the numbers 2134 and 501. The zeros had gone at the first step, on the way into Excel, and the .xlsx kept the result.

If the zeros or the long numbers matter, the .xlsx has to be made without Excel reading the values as numbers first. That is what the CSV viewer on this site does: it reads the file as text, marks the common cases Excel would change, and writes the .xlsx with those columns stored as text.

The CSV viewer with an opened orders file and the Download Excel file button in the file bar

What we measured

We made a file of 200,000 made-up orders with 10 columns: order number, name, email address, zip code, date, product code, quantity, price, status and a short note. The names and notes are drawn from small word lists, so the text is made of repeating parts. We opened the CSV in Excel 2024 on Windows with US settings, saved it as .xlsx from Excel, and opened that.

CSVXLSX
File size22,698,885 bytes (22.7 MB)17,081,906 bytes (17.1 MB)
Time to open in Excel2.0 seconds1.6 seconds

The .xlsx file was about a quarter smaller. Both opened in about two seconds on this computer. That was one run each, on one machine with plenty of memory, so read it as a rough picture of this file and not as a benchmark. About a tenth of the zip codes in that file start with a zero, and Excel turned the zip column into numbers when it opened the CSV, so the .xlsx holds the damaged zip codes too.

The limits of a sheet

An Excel sheet holds 1,048,576 rows by 16,384 columns, and a cell holds up to 32,767 characters (Microsoft’s specifications and limits, checked 29 November 2026). RFC 4180 sets no row limit for a CSV file, so a CSV can hold more rows than a sheet.

We made a CSV with a header and 1,048,576 data rows, one row more than a sheet can take, and opened it in Excel. Excel loaded 1,048,576 rows, the header and 1,048,575 data rows, and the last data row was not in the sheet. We ran this with Excel’s messages switched off, so we cannot say what Excel’s warning looks like on screen. Either way, if a CSV is close to a million rows, count the rows in the file before you trust a total taken from the sheet.

Which one to use

Choose XLSX when:

  • a person will open it in Excel to read it or work with it
  • the table has IDs, zip codes, phone numbers or barcodes, and the .xlsx is made without Excel reading a CSV first
  • you want formulas, several sheets or formatting to survive
  • you are sending it to someone in another country, whose Excel may expect another separator (why a CSV opens in one column)

Choose CSV when:

  • a program, a database or an upload form asks for it
  • the file may be opened on any system, in any editor
  • you want to compare two versions line by line, for example in version control
  • the data has more rows than a sheet can hold

When you are unsure, send both: the .xlsx for the person and the .csv for the machine. If you send a CSV, the checklist for sending a CSV lists what to set so it opens properly.

How we tested

Excel 2024 (version 16.0, build 20625) on Windows 11 with US settings, on 29 November 2026, with made-up files. We did not test Excel for Mac, Microsoft 365, Google Sheets or LibreOffice, and we did not time the files on a slow computer. The size of an .xlsx depends on the data, so your files will differ. How we test says more.

Sources

All checked on 29 November 2026.