What the video covers
Show three reliable ways to display or produce numbers with leading zeros in Google Sheets: (1) custom number formatting to keep values numeric, (2) TEXT() to produce padded text strings, and (3) REPT/LEN or RIGHT formulas for dynamic padding.
Watch the video on YouTubeStep-by-step instructions
- Custom number format (preserve numeric values)
Select the cells or column with the numbers to pad. Open the Format Number Custom number format dialog and enter a pattern made of zeros matching the total digits you need (for example, 00000 for five digits). Apply—this displays leading zeros while keeping the underlying values numeric. - TEXT function (produce padded text strings)
In a helper column, enter a formula like =TEXT(A2, "00000") where A2 is the source cell and "00000" sets the fixed width. Press Enter and copy or fill down to convert numbers into text strings padded with leading zeros. - RIGHT with fixed zero string (simple formula)
Use a formula such as =RIGHT("00000" & A2, 5) to prepend zeros and extract the rightmost digits to a fixed width (replace 5 with your needed width). Fill down the column to apply across the dataset. - REPT and LEN for dynamic padding
Use =REPT("0", 5 – LEN(A2)) & A2 to calculate how many zeros are missing and prepend them. This adapts to the length of each number; replace 5 with your target total digits. Fill down to apply. - Fill formulas down quickly
After entering a formula in the top cell of a helper column, double-click or drag the fill handle (small square at cell corner) to copy the formula down to match adjacent data automatically. - Choose the right method for your need
Use custom number format when you want to display padded numbers but keep them numeric. Use TEXT, RIGHT, or REPT/LEN when you need padded text for exports, concatenation, or systems that require string IDs.
Watch the video
Play tutorial
Why it matters
Spreadsheet tools often drop front zeros from ID numbers, zip codes, or invoice numbers because they treat inputs as numeric. Use these methods to ensure consistent digit lengths for display, exports, or concatenation without losing your data integrity.
Check your result
After applying a method, verify one or two cells: custom number format should show leading zeros while the cell remains numeric (right-aligned); TEXT or formula results will be left-aligned text and remain padded when exported or concatenated.
Troubleshooting
If zeros don’t appear: confirm you applied the custom number format to the correct range. If using TEXT/REPT/RIGHT, ensure source cells are not blank or contain non-numeric characters. If a formula returns #VALUE!, check that referenced cells are numeric or wrap them with VALUE() when appropriate. For very long ID fields, adjust the number of zeros in the pattern or formula to match the desired total width.