How to Keep Leading Zeros in Excel Numbers (Display 00001)
Question details
The user wants to know how to prevent Excel from automatically removing leading zeros when typing numerical sequences like 00001.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Entering numerical identifiers such as ZIP codes, employee IDs, product codes, or invoice numbers that begin with one or more zeros.
- Observed behavior
- Excel automatically deletes the leading zeros upon pressing Enter, reducing a sequence like 00001 to just 1, because it treats the entry as a standard mathematical value.
Determine if your data needs to be used in mathematical calculations later, or if it is purely for identification (like a ZIP code or ID number). This will help you choose between applying a custom number format or converting the cell to text.
Use Custom Formatting to Keep Numbers Numeric
This method forces Excel to display a specific number of digits, keeping the leading zeros visually while retaining the cell's underlying mathematical value.
Applying a Custom Number Format is the best approach when you need the data to remain numeric for sorting or calculating, but require a consistent visual length.
Highlight the specific cells, rows, or columns where you plan to type numbers that require leading zeros.
Right-click the highlighted area and choose "Format Cells" from the context menu, or simply press the Ctrl + 1 shortcut on your keyboard.
Navigate to the "Number" tab, select "Custom" from the Category list on the left, and type "00000" (five zeros) into the Type box. Click OK.
When you type a number like "1" in the formatted cell and press Enter, Excel will automatically pad it to display as "00001".

Add an Apostrophe to Store Numbers as Text
A quick workaround for a few cells is to force Excel to treat the entry as text by adding an apostrophe before typing the number.
Apply the Special ZIP Code Format
If you are dealing with standard 5-digit US ZIP codes, Excel features a built-in Special format designed to handle leading zeros automatically.
Easily Format Numbers and Retain Leading Zeros in WPS Office
WPS Spreadsheet offers identical formatting features to Microsoft Excel, allowing you to easily apply custom formats, convert cells to text, and use special built-in formats to keep leading zeros in your datasets.
- 1. Select your cells: Open your workbook in WPS Spreadsheet and highlight the cells you want to format with leading zeros.
- 2. Open Format dialog: Right-click the selection and click "Format Cells", or use the Ctrl+1 keyboard shortcut.
- 3. Set the Custom Format: Go to the "Number" tab, click on "Custom", and input the required number of zeros (e.g., "00000") in the Type field.
- 4. Save and type: Click OK. Begin typing your numbers, and WPS Spreadsheet will automatically display the leading zeros without deleting them.

Frequently Asked Questions
Why does Excel keep removing my leading zeros?
By default, Excel treats cell entries containing only digits as mathematical values. Because leading zeros do not change the actual value of a number (e.g., 001 is mathematically equal to 1), Excel removes them to save space and standardize data. You must format the cell as text or apply a custom number format to bypass this behavior.
Can I format numbers that are already typed to show leading zeros?
Yes. If you already have numbers in your spreadsheet, you can highlight them, open Format Cells (Ctrl+1), select Custom, and type "00000". Excel will automatically pad the existing numbers with leading zeros up to your specified digit count.
How do I export data with leading zeros to a CSV file?
When exporting to CSV, visual custom formatting is often lost. To ensure leading zeros are kept in a CSV, format the cells explicitly as Text before entering data, or use a formula like =TEXT(A1, "00000") in a new column to permanently convert the numerical values into text strings before saving.
How do I quickly format an entire column as text before typing?
Click the column header letter (e.g., column A) to select the entire column. Then, go to the Home tab, find the Number Format dropdown menu in the ribbon, and change it from "General" to "Text". Any number you type in that column going forward will keep its leading zeros.




