Preserve Leading Zeros in ZIP Codes When Importing CSV Files in Excel
Question details
Import a CSV file into Excel without losing leading zeros in ZIP codes.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A CSV file contains ZIP codes that need to remain intact when imported into a spreadsheet.
- Observed behavior
- Opening the CSV directly causes Excel to interpret ZIP codes as numbers and remove leading zeros.
Locate the original CSV file and identify the ZIP code column. Check whether the codes are all five digits or include other formats, such as ZIP+4, before choosing a method.
Import the ZIP Code Column as Text with Power Query
Use this method to preserve ZIP codes before Excel converts them to numbers.
In Excel, select Data > Get Data > From File > From Text/CSV, choose the original CSV file, and select Import.
In the import preview, choose Do not detect data types if that option is available, then select Transform Data.
In Power Query, check Applied Steps and remove an automatic Changed Type step if it converted the ZIP codes. Select the ZIP code column, then choose Data Type > Text.
Select Home > Close & Load and check that ZIP codes with leading zeros appear as expected.

Import ZIP Codes as Text with the Legacy Text Import Wizard
Use the legacy wizard if it is available in your version of Excel and you prefer to set column formats during import.
Restore Five-Digit ZIP Codes with a Formula
Use this method when ZIP codes have already been converted to numbers and every code should have five digits.
Preserve ZIP Codes When Importing CSV Files in WPS Spreadsheets
Use the text import options in WPS Spreadsheets to identify the ZIP code column as text before loading the CSV data.
- 1. Open the CSV file: In WPS Spreadsheets, choose Menu > Open and select the original CSV file.
- 2. Set the delimiter: In the text import dialog, select the delimited option and choose Comma.
- 3. Set ZIP codes to text: Select the ZIP code column in the preview and set its column format to Text before completing the import.
- 4. Check and save the data: Finish the import, verify the leading zeros, and use Save As to save the spreadsheet in your preferred format.

Frequently Asked Questions
Why does Excel remove zeros from ZIP codes in a CSV file?
When you open a CSV directly, Excel may interpret ZIP codes as numbers. Numbers do not retain leading zeros, so import the ZIP column as Text instead.
Can I restore a zero by changing the column format to Text?
No. Changing the format after conversion does not recover a removed zero. Reimport the original CSV as text, or use =TEXT(A2,"00000") if the codes should all be five digits.
How do I prevent Power Query from converting ZIP codes automatically?
In the From Text/CSV preview, select Do not detect data types if available. In Transform Data, remove any automatic Changed Type step that converted the ZIP column, then set that column's data type to Text.
Will the five-digit TEXT formula work for ZIP+4 codes?
No. The formula =TEXT(A2,"00000") is intended for five-digit codes and cannot reconstruct a missing hyphen or other lost characters. Import ZIP+4 values as text from the original CSV.




