Excel removed the leading zeros from my CSV (zip codes, IDs)

Your zip code column had 01234, 00042, 07417. After a round trip through Excel they're 1234, 42, 7417. Same story with product codes, employee IDs, phone numbers, bank routing numbers — anything that's really a string of digits but happens to look like a number. The leading zeros are just gone.

before: 01234 00042 07417 after: 1234 42 7417

Why Excel does this

When Excel imports a column and every value looks numeric, it stores the column as numbers. And the number 01234 is identical to 1234 — the zero in front carries no mathematical value, so Excel drops it. The fact that this was a five-digit code, not the quantity 1,234, isn't something a number can hold. Save the file and the padded version is gone for good.

The manual fix: mark the column as text first

Tell Excel the column is text before it reads the values:

  1. Blank workbook, Data ▸ From Text/CSV.
  2. Pick the file. In the preview, click the header of the zip / ID column.
  3. Set its type to Text (dropdown in the modern importer, "Text" radio button in the legacy wizard).
  4. Load. 01234 stays 01234.

If you've already lost the zeros and you know the width every code should be — say five digits for a US zip — you can rebuild them: select the column, Format Cells ▸ Custom, and enter 00000. That's a display trick, though; the stored value is still 1234, so re-exporting to CSV can drop them again. Converting to real text with =TEXT(A2,"00000") is safer.

Or just drop the file here and let the tool do it. It keeps every cell as text from the start, so nothing gets turned into a number. Turn on "Restore leading zeros," pick the column, and set the width (5 for a zip, 11 for a phone, whatever yours needs). It shows how many rows it will touch, you preview, you download. All in your browser, nothing uploaded.

Fix my CSV

← Back to the CSV Fixer tool