FormulaCraft

How to add leading zeros in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=TEXT(A2, "00000")

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1A2 is the number to pad.
  2. 2"00000" forces a five-character result, adding zeros at the front.
  3. 3The result is text — fine for codes and IDs.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Why do my leading zeros disappear?

Numbers drop leading zeros by default. Use TEXT(A2, "00000") to keep them, or format the cell as Text or with a custom 00000 format.

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: