Why Does Excel Remove Leading Zeros From CSV?
Excel removes leading zeros when it interprets digit-only CSV text as a number, even though postal codes, SKUs, account references, and phone fragments are identifiers.
Open CSV to Excel ConverterImport the CSV through From Text/CSV and set identifier columns to Text before loading, or convert the untouched CSV to XLSX with those cells stored as text. If Excel already removed or rounded digits and the file was saved, recover from the original export rather than guessing.
CSV cannot declare a text column
A CSV field contains characters and separators; it does not carry an Excel cell type or number format. When a .csv file is opened directly, Excel applies automatic data conversion. Microsoft documents that this can remove leading zeros, convert E-containing identifiers to scientific notation, interpret date-like strings, and retain only 15 significant digits in long numbers.
The conversion is reasonable for quantities but destructive for identifiers. 00123 and 123 can identify different products even though they are the same numeric value. Treat postal codes, account numbers, membership IDs, and similar digit strings as text at import time.
Use an import flow with explicit types
In current desktop Excel versions, use Data → From Text/CSV, choose Transform Data, select the identifier columns, and set their type to Text before loading. Microsoft also provides Automatic Data Conversions options in supported versions, including a setting that prevents removal of leading zeros.
For repeat work, Power Query records those type choices and can refresh the same export consistently. Opening the file by double-clicking gives you less control because default formats are applied immediately.
Use XLSX when types are part of the deliverable
An XLSX workbook can store a cell as text, so the type travels with the value. The CSV to Excel converter writes CSV values as text and avoids inventing formulas or date types. Verify identifiers, dates, and long numbers after conversion, then share the XLSX when the recipient needs spreadsheet types.
A custom number format such as 00000 only changes display and assumes a fixed length. It cannot know how many zeros were lost from previously converted values, and it does not solve identifiers with varying lengths.
Know what is recoverable
If 00123 became 123 but the untouched CSV still exists, the information is recoverable by importing correctly. If the converted workbook or CSV was saved over the source, the number of missing zeros is unknown unless an external rule defines the exact length.
Long numeric strings have an additional risk: Microsoft states that Excel numeric precision is limited to 15 significant digits. Digits beyond that can become zeros, which formatting cannot restore. Compare a few source identifiers character-for-character before trusting the result.
Broken and corrected examples
Postal code opened as a number
PostalCode
00123 → displayed as 123Import PostalCode as Text → 00123The zeros are part of the identifier, not optional numeric formatting.
Long account identifier
12345678901234567 → 12345678901234500Set the column to Text before Excel converts itAfter numeric precision is lost and saved, formatting cannot reconstruct the final digits.
How to fix it safely
- Return to the untouched CSV and confirm the zeros and all long digits are still present in a text preview.
- Use Excel's From Text/CSV flow and set identifier columns to Text before loading, or open CSV to Excel Converter.
- Save as XLSX when the recipient needs the text type preserved with the cells.
- Compare representative postal codes, SKUs, E-containing IDs, dates, and 16-plus-digit values with the source.
Common questions and edge cases
Can a custom 00000 format restore zeros?
It can display a known fixed width, but it does not restore unknown original data and is unsuitable when valid identifiers have different lengths.
Why does adding an apostrophe work?
Excel treats a manually entered leading apostrophe as a text-entry signal. It is not part of standard CSV typing and is awkward for bulk interchange; explicit import types are safer.
Does saving as CSV preserve Excel's Text format?
No. CSV does not carry spreadsheet cell types or formats. The characters are written, and another application may infer types again when reopening.