Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Pasting Leading Zeroes.

Pasting Leading Zeroes

by Allen Wyatt
(last updated January 31, 2018)


Some data requires leading zeroes. The first example that comes to mind is ZIP Codes, in which some have leading zeroes. There are other examples, as well. For instance, you may have a chart of accounts in which general ledger account numbers start with leading zeroes.

When you paste information into Excel, it normally tries to "parse" the data and put it in a format that it can work with. When you paste data that have leading zeroes, and the data could reasonably be construed as numbers, then Excel strips the leading zeroes from what you are pasting. For instance, 0012387 become a number value, 12387.

What if you want to retain the leading zeroes? All you need to do is make sure that the target cells—the ones that will receive the data being pasted—are formatted as text. Follow these steps:

  1. Select the cells that will hold the data you are going to paste.
  2. Choose the Cells option from the Format menu. Excel displays the Format Cells dialog box.
  3. Make sure the Number tab is selected. (See Figure 1.)
  4. Figure 1. The Number tab of the Format Cells dialog box.

  5. In the Category list, choose Text.
  6. Click on OK.

Whatever you now paste into the formatted cells is assumed to be text, and Excel will leave your leading zeroes exactly as you expect them.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2752) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Pasting Leading Zeroes.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Adding Hyphens to Phrases

Editing text to turn regular words into hyphenated phrases can be a real bother. The chore can become a breeze if you ...

Discover More

Using the System Configuration Utility

Want to change what happens when Windows is started? It's easy to make changes if you know how to use the System ...

Discover More

Making Highlighting Disappear when Typing

Select a highlighted word or phrase and start typing, and Word maintains the highlighting on what you enter. If this ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Filtering Columns for Unique Values

Given a long list of names, part numbers, or what-have-you, you may need to determine the unique values within the list. ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 0?

2020-01-24 09:39:19


Wow! this is great. Can confirm it works (2020/01/24)

2020-01-03 06:21:09


Hi, this did not work for me january 3rd, 2020.

Copying from Google Sheets to Excel on Mac.

2018-09-26 20:48:18


Just saved me tons of time!

2018-03-21 09:52:29


Does not work...

2018-02-12 00:08:45


Thank you it helped... God Bless Your Effort

2017-11-30 15:43:54


terrible info. does NOT work

2016-05-20 10:31:10


I have a column of data that is 5 digit numbers ie 00043. i need the column to be text, so i copied into notepad, formatted the column in excel to text, and pasted back into excel from notepad. The numbers that paste are now in text format, but some are lost. The first nine or so rows are "00000" and when i paste only one "00000" transfers. i have fewer rows than i started with and they do not match up with the other data in that row because of the lost data. suggestions?

2015-07-23 18:47:16


Worked perfectly, thank you! I was copying from SQL Server Management Studio and frustrated by the leading zeros disappearing in account coding.

2015-01-31 08:44:18


Micky, you are correct -- I misread what he asked.

If I follow the steps which I posted in the comment, below, I get exactly what I said -- exactly what the tip says.

If I do the copy from the browser window and paste using Ctrl+V into a Text-formatted cell, the leading zeroes do disappear. And, interestingly enough, Excel changes the format of the cell from Text back to General.

Very frustrating and potentially confusing. Excel seems to take the formatting of the original source into account when pasting. You can see this if you choose File | Paste Special to see the options that Excel gives you.

The Paste Special dialog box, when displayed with "from the browser" content in the Clipboard, shows three pasting options: HTML, Unicode Text, and Text. HTML seems to be the primary pasting option, as it is selected by default. When displayed with "from Notepad" content in the Clipboard, it shows only Unicode Text and Text as the pasting options.

I agree with you; the only way to make sure that the leading zeroes are retained when using Excel 2003 is to use Paste Special and choose either Text or Unicode Text as the pasting format. If, however, what you are copying started out as text (and cannot be interpreted by Excel as some other format, such as HTML), then you can skip using Paste Special and paste directly into the cell.


2015-01-31 05:55:25

Michael (Micky) Avidan

After checking in "Excel 2003" it seems to be almost the same move:
Choose "Paste Special" > "Text".
Note: The cell(s) must be formatted as "Text" before applying the above procedure.
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)

2015-01-31 05:43:20

Michael (Micky) Avidan

You DID NOT do exactly(!) what he asked.
Try to copy/paste the 0012387 from row 9, in the above tip, into a cell (formatted as Text) and see what happens.
The easiest solution is to paste it via right click and selecting "Match Destination Format" (this is my free translation from my Hebrew interface 'Excel 2013')
*** Didn't check, yet, the behavior in Excel 2003)
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)

2015-01-30 16:26:40


Did (again) exactly what you asked, Eric.

1. Opened Notepad and typed into it "0012387" (without the quote marks).
2. Started Excel and formatted a column as Text.
3. Switched back to Notepad, selected what I had typed in and pressed Ctrl+C to copy it.
4. Switched to Excel, selected a cell in the formatted column, and pressed Ctrl+V.

The result? The number showed, with leading zeroes--as text within the cell and like it looked in Notepad--just like the above tip states.


2015-01-30 16:15:02


why do people post solutions like this that clearly don't work??? Mr Wyatt, why don't you format a column as text, and then copy/paste in 0012387 from your own article, and see what happens?

This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.