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

AspectExcel (.xlsx)CSV (.csv)
Data modelCells with types, styles and formulasPlain text grid, values only
Number typesDistinguishes int/float/date/currency/percentEverything degrades to strings
Leading zerosKept when the cell is text-formattedLost if parsed as a number (001 becomes 1)
FormulasStores the formula and its logicOnly the result value survives
Styles & mergesFonts, fills, borders, merged cells preservedAll lost — position only
Multiple sheetsOne file holds many sheetsSingle-table structure
File sizeXML structure plus styles, relatively bulkyPlain text, typically an order of magnitude smaller
EditingGUI, suited to manual entry and reviewText 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