Excel is aggressive about guessing data types. That helps when a column is obviously a number, but it breaks identifiers like 00123, 000456, ZIP codes, product SKUs, employee IDs and account numbers.
When Excel sees 00123 in a CSV, it often converts the value to the number 123. The original zeros are gone from the spreadsheet view, and if you save the file again, they may be gone from the file too.
Why Excel removes leading zeros
A CSV file does not store column types. It is just text:
customer_id,zip_code,total
000123,02108,42.50
000124,94105,19.99
When you double-click that file, Excel guesses each column type. 000123 looks numeric, so Excel stores it as a number. Numbers do not have leading zeros, so the display becomes 123.
The fix is to tell Excel, before import, that those columns are text.
Best fix: use Excel’s import wizard
Do not double-click the CSV. Open Excel first, then import it.
- Open a blank workbook.
- Go to Data -> From Text/CSV.
- Pick your CSV file.
- In the preview, choose Transform Data or the column type controls.
- Select the ID, ZIP, SKU or account-number column.
- Set the column type to Text.
- Load the data.
This preserves 000123 as text instead of converting it to a number.
Fast fix: convert the CSV to XLSX first
If you need a real workbook, use the CSV to Excel converter and check the preview before downloading. For mixed data, converting to .xlsx gives you a workbook format that can preserve text cells, column widths and future formatting better than repeatedly opening and saving raw CSV.
After opening the workbook, format ID-like columns as Text before editing or pasting more values.
Formula workaround for already-broken data
If Excel already turned 000123 into 123, and every value should be six digits, create a helper column:
=TEXT(A2,"000000")
That displays 123 as 000123. Copy the helper column, then paste values if you need to replace the original column.
This only works when you know the target width. It cannot recover different original widths if Excel already destroyed that information.
Common columns that should stay text
Treat these as text even when they contain only digits:
- ZIP codes and postal codes
- Product SKUs
- UPC, EAN and barcode values
- Bank account numbers
- Customer IDs
- Employee IDs
- Invoice numbers
- Phone numbers
If you will not do math on it, it is probably not a number.
Do quotes fix it?
Not reliably. A CSV value like "000123" is still just a text field in the CSV format, but Excel may still infer it as a number when opening by double-click. Quotes protect commas and line breaks inside a field; they are not a dependable instruction to Excel about data type.
Use the import wizard, or convert to a workbook and set the column type deliberately.
Related fixes
If the whole file opens in one column, the problem is not leading zeros; it is probably a delimiter mismatch. See why CSV files show in one column.
If accents or currency symbols look broken, fix the file encoding first with the CSV encoding converter.