Format numbers to keep leading zeros in Excel for the web

When you type numbers that begin with zeros, like in some personal identification numbers, phone numbers, credit card numbers, product codes, or postal codes, Excel removes these leading zeros. To prevent this, you can first apply the Text format to the cells before you type or paste the numbers. Here’s how:

  1. Select the cells on your worksheet where you’ll be adding the data.

  2. On the Home tab, click Number Format >Text.

Text format for numbers

  1. Type or paste the numbers in the formatted cells.

Tip:  Also apply Number format for numbers that are 12 digits or more otherwise Excel for the web automatically applies the Scientific format and converts any numbers after the 15th digit to zeros.

Learn more about the available number formats and how to format numbers.

Need more help?

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.