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.
To pad numbers for display: select the range, Ctrl+1 ▸ Number ▸ Custom, and enter as many 0s as the width you need.
To keep typed zeros literally: format the empty cells as Text first (Home ▸ Number Format ▸ Text), then enter the values.
For a one-off entry, type an apostrophe before the value — '00742 — which forces text without changing the format.
To build a padded string from a number: =TEXT(A2,"00000").
To remove leading zeros from text: =VALUE(A2), or multiply the cell by 1 and copy ▸ Paste Special ▸ Values.
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.
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. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. Treat “leading zeros excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected cells shows up while it is still harmless. 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 turns a workspace setting that makes a big sheet comfortable to navigate into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Employee IDs should be five digits. If A2 holds 742, select the column, press Ctrl+1 ▸ Number ▸ 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. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.
In Google Sheets
Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Here is the takeaway for “leading zeros excel”: copy the answer if you are busy, but if you have a spare few minutes, rebuild the example in Excel yourself with the tool above open beside it. That single pass — type it, run it, watch the result move when you change an input — is what turns a formula you found into a technique you trust. Keep your inputs labelled and referenced, never hard-coded, and the same sheet stays correct and auditable as it grows. Done that way, you will not need to look this up again, and you will be the person others ask.
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
On the way here you may have searched this as “excel delete leading zeros”, “excel leading zeros formula” and “how to make excel keep leading zeros” — it is all the same task, and this page is the single, complete answer to it.
Why do people search for this in so many different ways?
Because the same task has many names. “excel delete leading zeros”, “excel leading zeros formula”, “how to make excel keep leading zeros” all point at the one operation explained on this page, which is why they all lead here.