How to Show Leading Zeros in Excel: A Step-by-Step Guide

Ever struggled with your Excel spreadsheet ditching those important leading zeros in your data? You know, when you type in ‘00123’, and Excel changes it to ‘123’? Well, fret not! I’ve got the lowdown on how to keep those zeros right where you want them. Trust me, it’s easier than you might think, and it’ll save you heaps of frustration.

Step by Step Tutorial: Showing Leading Zeros in Excel

Before diving into the steps, let’s establish what we’re aiming for here. We want to format cells in Excel so that they display numbers with leading zeros – those nifty digits before the main number that are usually lost in the abyss of Excel’s default settings. Ready? Let’s get started.

Step 1: Select Your Cells

Click and drag to highlight the cells where you need to show leading zeros.

Selecting the right cells is crucial because the formatting we’re about to apply only affects the cells you choose. Make sure you’ve got them all!

Step 2: Open the Format Cells Dialog Box

Right-click on the selected cells and choose ‘Format Cells’ from the context menu.

This is where the magic happens. The Format Cells dialog box is the control room for all things formatting in Excel, and it’s where we’ll be able to tell Excel to keep those leading zeros visible.

Step 3: Choose ‘Custom’ from the Category List

In the Format Cells dialog box, click on the ‘Number’ tab, then select ‘Custom’ from the category list on the left.

Custom formatting is the key to our zero dilemma. This option allows us to create our own number format that defies Excel’s default settings.

Step 4: Enter the Custom Format

In the ‘Type:’ field, enter the format that includes the leading zeros you want, such as ‘00000’ for a five-digit number with leading zeros.

What you type here tells Excel how to display the number. For instance, if you always want your number to be five digits, with leading zeros filling in the blanks, ‘00000’ is what you’ll enter.

Step 5: Click OK

After entering your custom format, click ‘OK’ to apply it to the selected cells.

And voilà! The cells will now keep those pesky leading zeros visible, no matter how much Excel might want to remove them.

After completing these steps, any numbers you enter into the formatted cells will display with the leading zeros intact. This means you can type ‘123’ into a cell formatted with ‘00000’, and it will display as ‘00123’. Neat, right?

Tips for Showing Leading Zeros in Excel

  • If you’re dealing with a set number of digits, like a zip code or product code, customize the format to match the exact length required.
  • For a quick fix, you can also type an apostrophe (‘) before your number to keep the leading zero. Excel treats it as text, which keeps the zero visible.
  • Remember that formatting cells as text will also preserve leading zeros, but be cautious—this might affect numerical calculations.
  • If you’re importing data from another source, check the ‘Text’ option during the import process to prevent Excel from stripping away those leading zeros.
  • You can use the same custom format for multiple columns or rows by copying the format from one set of cells to another with the Format Painter tool.

Frequently Asked Questions

How do I keep leading zeros in Excel when opening a CSV file?

When opening a CSV file in Excel, import the data using the ‘Text Import Wizard’, and be sure to select the ‘Text’ column data format for the columns that contain leading zeros.

Can I use leading zeros in calculations?

When you format a cell to show leading zeros, the actual number doesn’t change, only how it’s displayed. So yes, you can use these numbers in calculations without any issue.

How do I add leading zeros to a number that’s already in a cell?

Simply apply the custom formatting to the cell, and Excel will automatically add the zeros for you based on the format you’ve set.

Will adding leading zeros affect sorting and filtering?

No, adding leading zeros doesn’t affect the sorting and filtering functions in Excel. They’ll still work as expected.

Can I save a custom format for leading zeros to use in other spreadsheets?

Unfortunately, Excel doesn’t allow you to save custom number formats. You’ll need to reapply the format in each new spreadsheet.


  1. Select the cells where you want to show leading zeros.
  2. Open the ‘Format Cells’ dialog box by right-clicking the selected cells.
  3. Choose ‘Custom’ from the category list.
  4. Enter the desired custom format in the ‘Type:’ field.
  5. Click ‘OK’ to apply the format.


Showing leading zeros in Excel doesn’t have to be a headache. With these straightforward steps, you’ll be formatting cells like a pro in no time, ensuring that your data looks exactly the way you need it to. Whether you’re dealing with zip codes, product serial numbers, or any other data where those zeros are crucial, custom cell formatting is the solution you’ll reach for time and time again.

Keeping your data accurate and presentable is essential, especially in professional settings where details matter. And now that you know how to show leading zeros in Excel, you’re equipped to handle one of the many nuances that come with spreadsheet management. So go ahead, give it a try, and watch as those zeros fall in line—just the way you want them.

Join Our Free Newsletter

Featured guides and deals

You may opt out at any time. Read our Privacy Policy