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

Pasting Leading Zeroes

by Allen Wyatt
(last updated September 27, 2016)


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. Display the Home tab of the ribbon.
  3. Click the small icon at the lower-right corner of the Number group. Excel displays the Format Cells dialog box, with the Number tab 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 (12477) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel 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 Vertical Lines between Columns

Columns can be an integral part of your document layout. In some instances you may want Word to insert a vertical line ...

Discover More

Can't Save Edited Document

Each day of using Word is filled with opening documents, editing them, and then saving those changes to disk. So it can ...

Discover More

Saving Money on Printing Labels

Labels can be expensive, and a little common sense will help you waste less money as you try to get your labels to appear ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Relative Worksheet References when Copying

Copy a formula from one place to another and Excel helpfully adjusts the cell references within the formula. That is, it ...

Discover More

Highlighting the Rows of Selected Cells

If you lose your place on the screen quite often, you might find it helpful to have not just a single cell highlighted, ...

Discover More

Getting Rid of All Rows Except the One for the Latest Date

As you use Excel to collect data over time, sometimes winnowing out the latest data can present a challenge. Here are a ...

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 6 - 3?

2016-09-28 05:27:00



you could also format the cells(or columns)from the custom tab.

This would allow them to be stored as numbers and also act as data verification.

2016-09-27 19:02:10

Dermot McNamara

Isn't the problem people have been having coipying from another programme that the source formating is over writing the formating of the destination cell.
Using paste special and selecting text will keep the leading zeros in a cell formated for text.

2016-09-27 16:16:14

Thomas Papavasiliou

If you copy the data from another area, sheet or book, you may use the paste special command and paste the formats as well.

2016-09-27 14:31:07

Gary Harlow

Rather than formatting to text, use "custom" formatting with "0#####.00" with or without a decimal, in order that the value can be calculated, sorted, and/or otherwise utilized. As a text value, it would require additional functions, such Value, to be sorted sequentially, or otherwise.

2016-09-27 11:52:53


Funny enough, I notice this tip was written in 2013. Has Excel changed it behaviour since then?

2016-09-27 11:50:59

Luis Panozzo

Unfortunately I have to concur with the "not working" situation (Excel for Mac Version 15).
If i define the cell as text and enter 0098 ... I get 0098 (left justified).
But if I copy 0098 from Word and paste it in the cell, I get 98 (right justified)
Moreover, the pull down menu in the ribbon changes from Text to General.

2016-09-27 11:08:27

Don Meyerson Sr

Another way is to enter the characters with a leading apostrophe. Then the entry is automatically formatted as text.

2016-09-27 10:59:20

Peg Molter

I tried this and it didn't work. I intentionally formatted the Excel cells as text before copying cells from a Word table that contained leading 0s. As soon as I pasted them into Excel, Excel interpreted them as numbers, reformatted the cells accordingly, and again, omitted the leading zeros. Of course it works in Excel if the numbers you copy are already in Excel and contain an apostrophe, because that gets copied along with the contents. But I don't think that was the intent of this tip.

2016-09-27 09:41:06


Unfortunately this doesn't seem to work for me. I have a sheet that is updated by multiple users and they copy out of 1 program and paste into the sheet. Even changing the cell to TEXT, when the data from the program is pasted into that cell, Excel changes the formatting to general and removes the leading zero. I would love other tips besides adding a leading ' because we have a lot of non excel users and it is a chore to clean up every week since they don't understand excel.

2016-09-27 07:30:37


Another option would be to use the =text(A3,"00000") formula in the original document and then copy and paste as values in the receiving document.

2014-06-19 12:02:06

Ted Babcock

This is a great tip, and I've been using it for small sets of data. However, sometimes I'm pasting many columns, with mixed data types, and so I have to go through and mark just specific columns as Text. Isn't there a way to tell Excel a general rule? "If it looks like a number but has leading zeroes, treat it as text." Thanks!

2013-02-18 10:26:29

Glenn Case

You can also use a custom format to format your numbers with leading zeros; for instance, for zip codes, a format of 00000 will produce a 5-digit number perfaced with zero as needed.

This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu 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.