Add Leading Zeros in Excel: Make Values the Same Length or Add Fixed Zeros
Adding leading zeros in Excel serves multiple purposes—from formatting numbers to a fixed length (like invoice numbers or product codes) to simply adding a specific number of zeros in front of values for consistency or system requirements. But when you manually type leading zeros, Excel will remove them. Depending on your needs, this tutorial offers several ways to achieve this, including formulas, formatting tools, and third-party add-ins like Kutools for Excel. This tutorial covers both scenarios: how to make values the same length by padding with leading zeros, and how to add a fixed number of leading zeros to numbers or text.
- Use the TEXT function to pad numbers with leading zeros
- Use the format cells feature to pad numbers with leading zeros
- Use the CONCATENATE function to add a fixed number of zeros
- Easily Add Leading Zeros Using Kutools for Excel
Add leading zeros to make numbers the same length
Sometimes, you need all entries—whether numbers or codes—to be exactly the same length, such as five or six digits. Excel provides two straightforward methods to accomplish this: one using formulas and one using cell formatting.
Use the TEXT function to pad numbers with leading zeros
The TEXT function is ideal for converting numbers to a fixed-length format by padding with leading zeros. This is especially useful when the numeric value matters less than its visual uniformity.
Suppose you have a range of numbers and want to make them all six digits by adding leading zeros. You can apply the following formula to get it done.
Enter this formula in a blank cell and drag the fill handle down to apply it to other cells. Each number will now appear as a six-digit value with leading zeros.
=TEXT(A3, "000000")

Use the format cells feature to pad numbers with leading zeros
If you prefer to keep your values as numeric (for calculations, sorting, etc.), the Format Cells option changes only how they look, not how they behave. Please do as follows.
- Select the range of cells you want to make the values the same length.
- Right-click and choose "Format Cells" to open the "Format Cells" dialog box Tip: You also can press the "Ctrl" + "1" keys to open this dialog.
- In the dialog box, go to the "Number" tab, select "Custom" from the "Category" list, and in the "Type" field enter the number format, such as "000000" for six digits.
- Click "OK".
The numbers will now appear with leading zeros, matching the specified format.

Add a fixed number of leading zeros to numbers or text
In some cases, you might need to add a fixed number of zeros to each value, regardless of its original length. This approach is often used to add prefixes for visual emphasis or system compatibility.
Use the CONCATENATE function to add a fixed number of zeros
You can use CONCATENATE or the & operator to prepend a fixed number of leading zeros to values, which is useful for fixed formatting regardless of the original value’s length.
Suppose the values are in the range A3:A10.
In C3, enter the following formula. Then drag the fill handle down to apply to other rows.
=CONCATENATE("000", A3)

- This converts the result into text format.
- This formula also applies to text-formatted cells.
Easily Add Leading Zeros Using Kutools for Excel
For users handling large datasets or wanting a no-formula solution, Kutools for Excel makes it easy to batch-add fixed leading zeros with just a few clicks.
After installing Kutools for Excel, select "Kutools" > "Text" > "Add Text". Then configure as follows.
- Select the cells where you want to add leading zeros.
- In the cText" field, enter the desired number of zeros with a leading apostrophe. For example, entering '0000 will add 4 leading zeros to the selected cells.
- Select the "Before first character" option.
- Click "OK".
Leading zeros will be added to each selected cell. The Add Text tool also supports adding text at the end or within the content.
Whether you're aiming for consistency in the length of numeric codes or just need to prepend a fixed number of zeros, Excel provides flexible methods to suit different needs. Use the TEXT function or format settings for length-based padding, and leverage CONCATENATE or Kutools for fixed-prefix requirements. By mastering these techniques, you’ll make your data cleaner, more professional, and easier to work with—whether it’s for analysis, printing, or system uploads.
Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now
Demo: Add leading zeros to numbers or text with Kutools for Excel
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!