Excel to CSV: Differences, Edge Cases & Pitfalls
Convert Excel workbooks to CSV: sheet selection, encoding and leading-zero-preserving text output decided up front.
Excel to CSV is a reduction: from a typed, styled grid down to plain text. CSV keeps values but no types, so leading zeros, long numbers and date formats depend entirely on how the consumer reads them. Set the fragile columns as text before exporting rather than patching later.
Format Differences
| Aspect | Excel (.xlsx) | CSV (.csv) |
|---|---|---|
| Data model | Cells with types, styles and formulas | Plain text grid, values only |
| Number types | Distinguishes int/float/date/currency/percent | Everything degrades to strings |
| Leading zeros | Kept when the cell is text-formatted | Lost if parsed as a number (001 becomes 1) |
| Formulas | Stores the formula and its logic | Only the result value survives |
| Styles & merges | Fonts, fills, borders, merged cells preserved | All lost — position only |
| Multiple sheets | One file holds many sheets | Single-table structure |
| File size | XML structure plus styles, relatively bulky | Plain text, typically an order of magnitude smaller |
| Editing | GUI, suited to manual entry and review | Text editors and scripts, suited to automation |
Edge Cases
- Fields containing commas, newlines or double quotes must be quoted, with inner quotes doubled — otherwise columns shift.
- Text starting with = + or - (e.g. phone numbers) may be evaluated as a formula by Excel; prefix with a tab or set the text format.
- Numbers longer than 15 digits (order IDs, national IDs) are already float-damaged inside Excel — confirm the column was text before converting.
- Empty cells become empty strings, so "empty value" and "absent field" are indistinguishable downstream.
Common Pitfalls
- Exporting a formula column straight to CSV yields the formula text, not the computed value — paste as values first.
- Only the active worksheet is exported; the other sheets vanish silently with no warning.
- A BOM-less UTF-8 CSV looks like corrupted data when double-clicked in Excel.
- Leading zeros (001, postal codes) get eaten somewhere in the chain and are gone for good.
Related Tools
- Excel to CSVConvert Excel files to CSV with custom delimiter options and batch sheet conversion. Export data for databases or scripts via SheetJS, in the browser.
- Data Format ConverterConvert between JSON, YAML, TOML, XML and CSV in one place with a single paste and instant preview for seamless multi-format config and data conversion.
- Excel to JSONConvert Excel files (xlsx, xls, csv) to JSON format. Supports nested headers, sheet selection and key mapping. Choose the sheet and header row and keep numbers.
- JSON to CSVConvert a JSON array of objects to CSV with custom delimiters and headers, flatten nested keys and pick which fields to export for spreadsheet and BI tools.