CSV vs XLSX: what is the difference and when to use each format
Both formats show up all the time at work and look interchangeable, because both open in Excel. But they store data in very different ways, and choosing the wrong one causes anything from lost formatting to data changed without warning.
What a CSV file is
A CSV is a plain text file. Each line of the file is a row of the table, and values are separated by a character, usually a comma or a semicolon. There are no colors, column widths, formulas, charts or extra sheets: only values. That is why it is the universal format for exchanging data. Every system, database and programming language reads and writes CSV, and you can even open one in Notepad.
What an XLSX file is
XLSX has been Excel's workbook format since 2007. Inside, it is a compressed package of files that describe sheets, styles, formulas, charts and other elements. It stores the type of each cell (number, date, text), several sheets in one file, conditional formatting, data validation, filters and everything else you build in Excel.
Side-by-side comparison
| Feature | CSV | XLSX |
|---|---|---|
| Multiple sheets | No | Yes |
| Formulas | No (result only) | Yes |
| Formatting and colors | No | Yes |
| Cell types (text, number, date) | No, everything is text | Yes |
| Opens in any system | Yes | Needs compatible software |
| Best for | Importing and exporting data | Working with and sharing to people |
When to use CSV
Use CSV to move data from one system to another: importing products into an online store, uploading a contact list to an email platform, loading transactions into accounting software, feeding a database. The destination only wants the values, and CSV is the format it is guaranteed to understand. Text files are also easy to compare and to keep under version control.
When to use XLSX
Use XLSX when the file is going to people: reports, quotes, tracking sheets. It keeps the formatting that makes it readable, the formulas that keep totals up to date and several well-organized sheets. It is also the safer choice for data with leading zeros and dates, because every cell keeps its own type.
What happens when you convert
When you turn an XLSX into a CSV, only one sheet goes into the file, formulas become their calculated results and all formatting is lost. Choose the delimiter the destination expects and save as UTF-8 so special characters survive: Excel to CSV does both. In the other direction, from CSV to XLSX, the things to watch are the delimiter, encoding, leading zeros and dates, covered in the guide how to open a CSV in Excel. CSV to Excel handles those points automatically.
What about file size?
Because XLSX is compressed, it is usually smaller than a CSV with the same data. There is another important limit: an Excel sheet holds at most 1,048,576 rows. A CSV can have far more than that, in which case Excel opens only the beginning and warns that the file was not loaded completely. The fix is to split the CSV into smaller parts before opening it.
Frequently asked questions
No. A CSV holds a single table. To export several sheets from an Excel file, create one CSV per sheet.
CSV is plain text and cannot run anything. An Excel file with macros (.xlsm) can contain code; a regular .xlsx does not store macros.
The values are kept. What you lose when going to CSV is formulas (only results remain), formatting and the other sheets.