1. Home
  2. Free tools
  3. Email list tools
  4. Restore leading zeros in CSV

Restore leading zeros in CSV: put back the zeros Excel dropped from ZIP codes and IDs

In short: Upload a list, tick the code columns, set the length, and every all-digit code shorter than that is padded with zeros. Limit: It cannot tell which codes were short on purpose; set the length to the right one for the column.

Upload a CSV or .xlsx file, or paste it with a header row. Tick the columns that hold codes such as ZIP codes, and set how many digits they should have. Every code made only of digits and shorter than that is padded with leading zeros, so 2134 becomes 02134. Anything else is left as it was. Download the file.

Price: this tool is free. Checking a whole email list is from $9/mo, and the first 100 checks are free with Google, no card. Check your list free nowSee pricing

Runs in your browser. Nothing is uploaded.
Sample result from the Restore leading zeros in CSV
Show the sample result as

Sample result

Four example ZIP values set to 5 digits fix 2134 to 02134 and 501 to 00501; 90210 is already long enough.

Codes fixed
2
Left alone
0
Columns ticked
1

What this means for you

Restored codes do not show which addresses exist; a check does.

Next step:Verify the list
  • ZIP and postal codes
  • Your length
  • Digits only
  • Examples shown
  • Leading zeros
  • CSV
  • ZIP

By SimpleVerifier Team · Last updated · Runs in your browser; nothing you paste is sent to us

Codes fixed? Check the addresses before you import.

  1. Download the file, or use the check button under the result, which carries its addresses across.
  2. Upload or paste it at /verify. Every address gets a live mailbox check, and the first 100 email checks are free with a Google sign-in, no card.
Check the list

How do I restore leading zeros in a CSV column?

  1. Upload the file as a CSV or .xlsx, or paste the cells with the header row first.
  2. Tick the columns that hold codes; ones with a header such as Zip or Postal code are ticked for you.
  3. Set the length in digits, 5 for a US ZIP code.
  4. Check the examples and download the file.

Example

You enter
Four rows with a Zip column holding 2134, 90210, 501 and a blank, with the length set to 5.
You get
2 codes fixed: 2134 became 02134 and 501 became 00501. 1 code, 90210, was already 5 digits and the blank cell was left alone.
Limits
Runs in your browser; nothing is uploaded. It cannot tell which codes were short on purpose, and Excel may drop the zeros again when it opens the saved file.

Why does Excel drop leading zeros?

Excel and other spreadsheets treat a cell of digits as a number, and a number has no leading zeros. A ZIP code such as 02134 is saved as 2134 the moment the file is opened and saved again. The same happens to phone prefixes, account numbers, product codes and some IDs.

This tool pads the digits back to the length you choose. It cannot know which codes were really short, so set the length to the true one for that column.

Which cells are changed?

Only cells in the ticked columns that are made entirely of digits and are shorter than the length you set. Longer codes, blanks, and cells with letters, spaces inside, dashes or a decimal point are left alone and counted, so a ZIP+4 code such as 02134-1234 is not touched.

Different columns can need different lengths. Run the tool once for each length, ticking the matching columns each time.

How do I stop it happening again?

Open the saved file in Excel through Data, From Text/CSV, and set the code column to Text before loading it; double-clicking the file will drop the zeros once more. For a ready-made guide, see how to keep leading zeros when moving a CSV into Excel. To convert the file to a workbook, use CSV to Excel; to fix phone numbers, use the phone number formatter.

Who uses this tool, and for what?

Marketers
Repair ZIP codes in a customer export before a direct mail or an ad audience upload.
Sales operations
Restore account numbers that lost their zeros after a round trip through Excel.
Agencies
Fix postal codes in a client's lead list before importing it to a CRM.

What can’t this tool tell you?

  • It cannot tell which codes were short on purpose; set the length to the right one for the column.
  • Only cells made of digits are padded.
  • Excel may drop the zeros again when it opens the saved file.
  • Only the first sheet of a workbook is read.

Common questions

How many digits is a ZIP code?
Five in the United States. Many other countries use four, six or more, so set the length for your data.
Will it change codes that are already long enough?
No. Codes at or above the length are left alone and counted.
What about ZIP+4 codes with a dash?
They are left alone, because the cell holds more than digits.
Why do the zeros vanish again in Excel?
Excel reads the file as numbers. Import it with Data, From Text/CSV and set the column to Text.
Can I fix several columns?
Yes, if they share a length. Tick them all, or run the tool again for another length.
Is my file uploaded?
No. It is read in your browser and goes nowhere.

A tidy list can still be full of dead addresses.

Extracting, deduplicating and syntax checks all work on the text of an address. None of them can tell whether the mailbox exists. Only the server that hosts it can answer that, through an SMTP check, and that is what the paid product does.

  • Upload the cleaned file as it is: CSVs up to 100,000 rows
  • A real SMTP mailbox check on every row, with catch-all detection
  • Small list? Starter at $9/mo covers 2,500 emails a month, cancel anytime

Plans from $9 a month, cancel anytime, no contract. Sign in with Google and your first 100 email checks are free, no card. The free tools stay free either way.

Clean your next list before it bounces

100 free email checks when you sign in with Google, no card. Then monthly plans from $9, or one flat price with fair use, never cut off.

100 free checks, no card Cancel anytime Secure payment by Stripe