Written by Allen Wyatt (last updated March 22, 2025)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365
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 becomes a number value, 12387.
What if you want to retain the leading zeroes? The answer depends on whether you are copying and pasting from a non-Excel source or from data already in an Excel workbook.
Non-Excel Sources
If you are copying information from a non-Excel source, such as a text file or even from a website, including the leading zeroes is pretty straightforward. The key (and the part that many people miss) is to make sure that the target cells—the ones that will receive the data being pasted—are formatted as text before you do the pasting. Follow these steps:
Figure 1. The Number tab of the Format Cells dialog box.
You should now be able to paste with absolutely no problem. Formatting the cells as text means that Excel won't try to parse numbers as numbers, instead it will allow them to be pasted into the cells "as they are."
Excel Sources
If your data is in an Excel workbook, how you paste can seem a bit confusing at times. The key is to remember that there are two distinct parts to anything you copy and paste—content and formatting of that content.
As an example, let's say that the data you want to copy already has leading zeroes—you can see them on the screen! Sounds great, right? Well, you should select a cell that shows leading zeroes and then look at what you see in the Formula bar. If what you see there does not show the leading zeroes, then the value in the cell is a numeric value formatted to display those leading zeroes, probably using a custom format. If the Formula bar includes the leading zeroes, then the cell is more than likely formatted as text. In either case, you can copy and paste the cell and the formatting should travel with what you copy—meaning that what you paste will include the leading zeroes or at least appear to have leading zeroes.
If you don't want to copy the cell formatting, then you'll need to use Paste Special (click the down-arrow at the right of the Paste tool on the Home tab of the ribbon) to paste just the values. If you paste values into cells previously formatted as text (see earlier in this tip), then the numeric values are thereafter treated as text values. They won't, however, include any leading zeroes because the original numeric values didn't really have any leading zeroes.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12477) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Pasting Leading Zeroes.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
Select a range of cells, and one of those cells will always be the starting point for the range. This tip explains how to ...
Discover MoreWhen you undo actions within Excel, those steps you undo may affect the multiple workbooks in which you've been working. ...
Discover MoreWhen you are working with data created by other systems or other people, you often need to convert the data into ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
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.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments