ZIP Code Losing Its Leading Zero in Excel? Fix the CSV Import

October 19, 2026 • USAddressGen
On this page

If Excel shows 2108 instead of 02108, inspect the original CSV in a text editor before changing anything. An intact source file is easier to recover from than a spreadsheet that has been edited and saved over it.

Excel interprets CSV columns using its current defaults when you open a file directly. Numeric conversion can therefore change a postal identifier even though the downloaded file still contains every character. Microsoft’s CSV import documentation

Start with the file, not the cell’s appearance

Find the ZIP field in the original CSV using Notepad or another plain-text editor.

What the source containsWhat to do
02108, while Excel shows 2108Reimport the intact file with ZIP set to Text
2108, but an untouched backup existsStart again from the backup
2108, with evidence that only a leading zero was removed from a five-digit US ZIPConsider controlled padding in a separate column
An uncertain country, format or failure causeCheck the original data source before making repairs

The examples here are field test values, not verified delivery addresses. A basic US ZIP has five digits; ZIP+4 uses five digits, a hyphen and four more digits. Do not apply a five-digit repair to 02108-1234. USPS ZIP Code basics

Import an intact ZIP column as text

In Excel versions offering Data → From Text/CSV, open a blank workbook and select the original file. Choose Transform Data in the preview window, or Edit if that is the label your version uses.

In Power Query, inspect Applied Steps. An automatically added Changed Type step may already have converted the ZIP column to a number. Replace or remove that numeric conversion so the column is read from a step where the original zero still exists. Set its type to Text, choosing Replace Current if prompted. Check the preview, then Close & Load.

Changing an already shortened 2108 to text produces the string 2108; it does not reverse the earlier loss. That is why the position of the conversion matters. Microsoft’s type-detection explanation and leading-zero import instructions

If your version uses the legacy Text Import Wizard, choose Text for the ZIP column before completing the import. Menu names vary; the requirement is to preserve the source characters before numeric conversion.

When five-digit padding is appropriate

Use padding only after confirming that the field was a five-digit US ZIP and the only damage was removal of leading zeros. For a nonblank, nonnegative integer of at most five digits in A2, a separate output column can use:

=TEXT(A2,"00000")

This yields text 02108 from 2108, or 00501 from 501. Keep the original column for comparison. This example uses English Excel syntax; localized installations may use a different function name or argument separator. Microsoft’s TEXT function reference

Do not fill this formula down a mixed column containing blanks, ZIP+4 values, foreign postal codes or unexplained long values. Padding reconstructs a known width; it cannot prove that the ZIP exists, matches the city or belongs to a deliverable address.

A custom number format such as 00000 is useful for display within a workbook, but is not a portable text-type guarantee for another application. Microsoft’s guidance on custom formats

What our export check actually showed

We ran synthetic inputs through USAddressGen’s current CSV and JSON export functions:

Input ZIP valueCSV fieldJSON value
String 02108"02108""02108"
String 00501"00501""00501"
String 02108-1234"02108-1234""02108-1234"
Empty string""""
Number 2108"2108""2108"

The exporter preserved these text inputs, but did not invent a missing zero for the numeric input. This was a code-level export check, not a desktop Excel test. The import steps above come from Microsoft documentation.

CSV quotation marks delimit fields; "02108" does not tell every spreadsheet importer to keep that column as text.

Check the outgoing file too

Save to a new filename and inspect the resulting CSV in a text editor. Then import that new file with the ZIP column explicitly set to Text and compare its characters with your source. A five-digit appearance in the worksheet alone is not enough.

For a test workflow using the US address tool, include leading-zero, ZIP+4 and blank cases rather than checking only ordinary five-digit values. Keep those fixtures separate from real shipping records. When handing a CSV to someone else, tell them the ZIP column is a text identifier: the next direct open can otherwise repeat the same conversion.