# How to remove non-numeric characters in Google Sheets

Replace every non-digit with nothing: `=REGEXREPLACE(A2,"\D","")`.

**Google Sheets:** `=REGEXREPLACE(A2,"\D","")`

**Excel:** Microsoft 365 has REGEXREPLACE with the same pattern. In other versions, keep only the digits with `=CONCAT(IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,""))`.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Phone, as entered | Digits only |
| +1 (612) 555-0148 |  |
| 612.555.0193 |  |
| 1-763-555-0107 |  |
| (952) 555 0179 |  |
| Tel: 651/555/0161 |  |

Formula in B2, filled to B6: `=REGEXREPLACE(A2,"\D","")`

Result: 16125550148; 6125550193; 17635550107; 9525550179; 6515550161

## How it works

`\D` means any character that isn't a digit 0 to 9. REGEXREPLACE replaces every match, not just the first, so brackets, dots, dashes, spaces, slashes and letters all disappear in one step. The result stays text, which keeps leading zeros.

## Other ways

- `=CONCAT(IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,""))`: For Excel 2021 and later without regular expressions: every character that can't be multiplied by 1 is dropped.
- `=VALUE(REGEXREPLACE(A2,"\D",""))`: Convert to a number when the digits are an amount, not a code. (Numbers, which drop leading zeros and can show in scientific notation.)

## Common mistakes

- Decimal points are removed too: "$1,249.50" becomes 124950. Keep the dot with `"[^\d.]"`.
- Turning long codes into numbers loses leading zeros and precision past 15 digits. Keep IDs and phone numbers as text.

## Questions

**How do I keep only the last 10 digits?**

Take the right 10 characters: `=RIGHT(REGEXREPLACE(A2,"\D",""),10)`.

**How do I remove letters only?**

Use `"[A-Za-z]"` as the pattern.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/remove-non-numeric-characters
