Excel removes leading zeros from CSV
It is a classic frustration for data analysts: you open a CSV file containing ZIP codes, product SKUs, or employee IDs like 00123, and Excel automatically converts them to 123. The leading zeros are gone.
Why does this happen?
When you double-click a CSV file, Excel tries to be helpful by guessing the data type of each column. If it sees a column containing only digits (even if they start with zero), it assumes they are numbers. In mathematics, 00123 is the same as 123, so Excel "fixes" the formatting.
However, for identifiers, phone numbers, and codes, the leading zero is significant text data, not a mathematical placeholder.
Solution 1: Use the Import Wizard (Manual)
To prevent this, you must stop opening CSVs by double-clicking.
- Open a blank Excel workbook.
- Go to the Data tab.
- Click From Text/CSV.
- Select your file and click Import.
- In the preview window, do NOT click Load yet. Click Transform Data.
- Select the column with leading zeros.
- Change its data type from "Whole Number" to Text.
- Click Close & Load.
This works, but it requires many clicks for every single file you open.
Fix this automatically
SterileCSV is a desktop tool that automates this. It intelligently scans your CSVs. If a column looks like an ID (digits with leading zeros), SterileCSV forces the column to use the Text number format (code @) in the resulting Excel file.
No wizards, no clicks—just drag, drop, and get a perfect Excel file.