Remove Leading Zeros in Excel

“remove leading zeros in excel” comes up constantly, so this page leads with the exact answer, and only then explains the detail. Everything works in Excel on Windows and Mac and maps almost one-to-one to Google Sheets. Copy the answer above and get back to work, or read on to turn a one-off fix into something you never have to look up again.

Exact answer

In Excel: select the cells and apply a custom number format of 00000 (Ctrl+1 ▸ Custom) — the value stays a number and displays as 00742.

Annotated stepsExcel
1

To pad numbers for display: select the range, Ctrl+1Number ▸ Custom, and enter as many 0s as the width you need.

2

To keep typed zeros literally: format the empty cells as Text first (Home ▸ Number Format ▸ Text), then enter the values.

3

For a one-off entry, type an apostrophe before the value — '00742 — which forces text without changing the format.

4

To build a padded string from a number: =TEXT(A2,"00000").

5

To remove leading zeros from text: =VALUE(A2), or multiply the cell by 1 and copy ▸ Paste Special ▸ Values.

6

When importing a CSV, use Data ▸ From Text/CSV and set the column type to Text in the preview so the zeros survive the import.

=TEXT(A2,"00000")
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

Excel drops leading zeros because it stores the cell as a number, and 00742 and 742 are the same number. There are three fixes and they are not equivalent. A custom number format such as 00000 pads the *display* while the cell stays numeric, so it still sums and sorts numerically — this is right for fixed-width codes that are conceptually numbers. Formatting the cells as Text before typing keeps exactly what you type, which is right for identifiers such as ZIP codes, part numbers and phone numbers that should never be arithmetic. And =TEXT(A2,"00000") builds a padded text string from an existing number, which is what you need when exporting. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. For “remove leading zeros in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected cells change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a workspace setting that makes a big sheet comfortable to navigate useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Employee IDs should be five digits. If A2 holds 742, select the column, press Ctrl+1Number ▸ Custom, enter 00000 and the cell reads 00742 while =A2+1 still returns 743. If instead the IDs are pasted in as 00742 and must stay literal, select the empty column first, set Home ▸ Number Format ▸ Text, then paste. To strip leading zeros the other way, multiply by 1 or use =VALUE(A2), which turns the text "00742" back into the number 742. ZIP codes, product codes, cost centres and account numbers all carry meaningful zeros, and losing them turns a working lookup into a column of #N/A. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. If you take one thing from this page on “remove leading zeros in excel”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.

Common mistakes

  • Formatting cells as Text after the data is already in, which does nothing — the zeros were lost on entry and the format change does not bring them back.
  • Using Text format for values that later need to be summed or compared numerically.
  • Double-clicking a CSV instead of importing it through Data ▸ From Text/CSV, which silently strips the zeros before you ever see the file.
  • Applying a custom format and then exporting to CSV, where only the underlying value is written and the padding disappears — use TEXT() to build a real padded string for exports.
  • Mixing padded text and unpadded numbers in one column so lookups match on some rows and fail on others.

Frequently asked questions

How do I add leading zeros in Excel?

Select the cells, press Ctrl+1, choose Custom and enter a format of 0s matching the width you want — 00000 for five digits. The cell stays a number and displays the padding.

Why does Excel delete my leading zeros?

Because the cell is formatted as a number, and numerically 00742 equals 742. Format the cells as Text before typing, or use a custom number format to pad the display.

How do I remove leading zeros?

If they are text, =VALUE(A2) converts back to a number, or multiply the column by 1 and paste the values back. If they come from a custom format, change the format to General.

How do I keep leading zeros when opening a CSV?

Do not double-click the file. Open Excel first, then Data ▸ From Text/CSV, and in the preview set the affected column's type to Text before loading.

Other ways people ask this

People reach this page typing “how to remove leading zeros in excel”, “excel removing leading zeros”, “how to remove a leading zero in excel” and “how do you remove leading zeros in excel”, among other phrasings; whichever wording you used, the fix above is the one you want.

This guide also answers

  • deleting leading zeros in excel

Why do people search for this in so many different ways?

Because the same task has many names. “how to remove leading zeros in excel”, “excel removing leading zeros”, “how to remove a leading zero in excel” all point at the one operation explained on this page, which is why they all lead here.