Keep leading zeros when opening a CSV in Excel

Zip codes, phone numbers and product codes such as 00123 lose their zeros when Excel opens a CSV, because Excel treats them as numbers.

Open CSVFix

How to do it

  1. Drop your CSV file on CSVFix.
  2. Check the preview. Values such as 00123 appear exactly as in the file.
  3. Click Download Excel. Values with leading zeros are written as text cells, so the zeros stay.
  4. Open the .xlsx file in Excel.

Why the zeros disappear

The CSV file still contains the zeros. They disappear when Excel converts the value to a number while opening the file. Writing those values as text cells in an .xlsx file avoids that conversion.

Questions

Will normal numbers still work in formulas?

Yes. Plain numbers such as 42 are saved as numbers. Only values with leading zeros are kept as text.

What about very long numbers?

Excel keeps only 15 significant digits in a number. CSVFix saves values longer than 15 digits as text so they are not altered.

Can I keep it as CSV?

Downloading CSV keeps the zeros in the file, but Excel will drop them again when it opens it. Use the Excel download or import the file with Data, then From Text/CSV, setting the column to Text.

Ready to clean your file?

Clean your CSV now

More CSV guides