Exporting data usually offers two options: CSV or an Excel workbook. They look interchangeable when you open them, but they store very different things, and the wrong choice can cost you data or compatibility.
What each format is
CSV is plain text: rows on lines, values separated by commas. No formatting, no formulas, no types. See what is a CSV file.
XLSX is the default Excel workbook format. It is a ZIP archive containing XML files, defined in the Office Open XML standard (ECMA-376 and ISO/IEC 29500). It can hold multiple sheets, formulas, number and date formats, styles, charts, images, named ranges, filters and more.
Side-by-side
| CSV | XLSX | |
|---|---|---|
| Structure | Single flat table | Multiple sheets |
| Data types | None (all text) | Numbers, dates, text, booleans |
| Formulas | No (values only) | Yes |
| Formatting | None | Fonts, colours, widths, conditional formats |
| Charts and images | No | Yes |
| Readable in a text editor | Yes | No (zipped XML) |
| Typical size | Small | Larger for the same data, though compressed |
| Easy to generate in code | Very | Needs a library |
| Version-control friendly | Yes | Poor diffs |
| Opens in | Almost everything | Spreadsheet programs and libraries |
When CSV is the better choice
- Moving data between systems. Databases, analytics tools and APIs expect it.
- Large flat datasets. CSV can be streamed row by row. XLSX files are limited to 1,048,576 rows per sheet and must be loaded as a whole by many tools.
- Version control and automation. Text diffs show exactly what changed.
- Maximum compatibility, including old software and scripts.
- Avoiding hidden surprises from formulas or macros. XLSX files do not carry macros;
.xlsmfiles do, and those are a security consideration.
When XLSX is the better choice
- Anything people will read and edit as a report, with formatting, charts and totals.
- Data that must keep its types. A postcode stored as text in XLSX stays as text, where CSV cannot say so.
- Multiple related tables, because a workbook has several sheets and CSV has one table per file.
- Formulas that should stay live.
The data-integrity angle
The biggest practical difference is types. A CSV forces the receiver to guess whether 00501 is a number or a code, and whether 3/4/2025 is March or April; see CSV leading zeros and dates in Excel. XLSX records the answer. On the other hand, XLSX stores numbers as 64-bit floating point, so identifiers over about 15 digits need to be text to stay exact.
Converting between them
Saving an XLSX as CSV keeps only the active sheet, writes cell values as displayed, and drops formulas, formatting and charts. Check delimiter and encoding in the save dialog; spreadsheets offer "CSV UTF-8" as a separate option because the plain "CSV" choice may use a legacy encoding. See fixing garbled characters in CSV files.
Going the other way, import CSV through a wizard so you control the column types.
Checking a CSV
If you are producing CSV for another system, check it before sending. Docento's Text & Markdown Editor shows the raw text of a CSV, checks that every row has the same number of fields and lets you fix problems without opening a spreadsheet.
Takeaway
Use CSV to move flat data between systems and keep it in version control. Use XLSX when people will work with the file, or when types, formulas and multiple sheets matter. Whichever you choose, say which encoding and date format you used.