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. ...


Including a Data Table with Your Chart

Microsoft Graph allows you to display both your chart and data, if desired. All it takes is to make a simple change to a ...

Discover More

Placing Formula Results in a Comment

Excel won't allow you to directly or automatically insert the results of a formula into a cell's comment. You can, ...

Discover More

Hiding Formatting Changes in Track Changes

Word can easily (and handily) keep track of changes you make in your document. You may not want all your changes tracked, ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Automatically Breaking Text

Want to convert the text in a cell so that it wraps after every word? You could edit the cell and press Alt+Enter after ...

Discover More

Using Slashed Zeroes

To reduce the chances of confusion in presenting data, some people like to use zeroes with slashes through them. If you ...

Discover More

Changing Multiple Cells at Once

Excel includes several different methods of editing information in your cells. If you want to edit multiple cells all at ...

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 8 + 1?

2018-08-22 04:20:24


I have a solution for anyone still looking...

1. Copy your list of numbers into a .txt file using notepad. It should be a simple text file with a single column, and one number on each row.
2. Go to Excel where you want to insert the numbers. Use Data > From Text.
3. Select the .txt file for import. On step 3, ensure you format the data as 'text' before completing the import.
4. your column of numbers will be inserted as TEXT and will include leading zeros.


2018-07-09 11:44:37

Doesnt Work. Excel still removes leading zeros no matter how may times I change to TEXT

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.