How to Format Phone Numbers in Google Sheets: Strip Dashes and Spaces, Show (555) 010-1234, Handle +1 and Extensions, Then Find Duplicate Contacts (2026)

Phone numbers arrive in every shape: typed by hand, pasted from a CRM export, collected by a form. One contact is (555) 010-1234, the next is 555.010.2345, a third has +1 in front and a fourth ends in “ext. 12”. Besides looking untidy, this breaks lookups and duplicate checks, because to Google Sheets those are all different text. This guide cleans a phone column with built-in formulas, shows the result as (555) 010-1234, deals with +1, extensions, blanks and numbers that don’t fit, and then uses the clean column to find duplicate contacts.

The short answer

These recipes are for US and Canadian (North American) numbers, which have a 3-digit area code and 7 more digits. If your list mixes countries, read the international numbers section first.

The example

A contact list with ten rows. Rows 2 and 4 are the same person with different emails, rows 3 and 8 are the same number written two ways, row 5 was typed without punctuation (so Sheets stored it as a number), rows 6 and 10 share an office line with different extensions, row 9 is missing its area code, and two people left the phone blank.

RowA: NameB: EmailC: Phone
2Ana Ruizana@example.com(555) 010-1234
3Ben Coleben@example.com555.010.2345
4Ana Ruizana.ruiz@example.com+1 555-010-1234
5Cara Diazcara@example.com5550103456 (typed as a number)
6Dev Shahdev@example.com555-010-4567 ext. 12
7Eli Mosseli@example.com(blank)
8Ben Coleben.c@example.com1 (555) 010-2345
9Fay Linfay@example.com010-5678
10Gus Halegus@example.com555 010 4567 x15
11Hana Wuhana@example.com(blank)

The plan is three helper columns: D holds the 10 digits (the matching key), E the extension, and F the formatted number. You can delete D to F once the clean numbers are pasted back.

Step 1: keep only the digits

REGEXREPLACE replaces every part of the text that matches a regular expression. \D means “any character that is not a digit”, so replacing it with nothing strips spaces, dashes, dots, parentheses and the plus sign in one go:

=REGEXREPLACE(C2&"", "\D", "")

Why C2&"" and not just C2? Google’s REGEXREPLACE help page notes that the function only works with text input. Row 5 holds the number 5550103456, so REGEXREPLACE(C2, …) fails there. Joining an empty string with &"" turns the number into text first and leaves text unchanged.

Step 2: split off extensions, then drop the leading 1

Stripping non-digits from “555-010-4567 ext. 12” gives 555010456712, a 12-digit number that matches nothing. So remove the extension before stripping, and keep a US country code out of the key as well. Put this in D2 and fill down:

=LET(raw, C2&"",
  main, REGEXREPLACE(raw, "(?i)\s*(x|ext\.?|extension)\s*\d+\s*$", ""),
  d, REGEXREPLACE(main, "\D", ""),
  IF(AND(LEN(d)=11, LEFT(d,1)="1"), RIGHT(d,10), d))

main is the number without a trailing x12, ext 12, ext. 12 or extension 12 ((?i) makes the match ignore letter case, so EXT and Ext work too). d is its digits. The last line drops the 1 from +1 555-010-1234 and 1 (555) 010-2345, which both have 11 digits starting with 1. Everything else passes through untouched.

To keep the extension, pull it into E2 with REGEXEXTRACT, which returns the part in parentheses:

=IFERROR(REGEXEXTRACT(C2&"", "(?i)(?:x|ext\.?|extension)\s*(\d+)\s*$"), "")

IFERROR returns an empty cell for rows without an extension, where REGEXEXTRACT finds no match.

Step 3: format as (555) 010-1234

With the 10 digits in D and the extension in E, put this in F2 and fill down:

=IF(LEN(D2)<>10, C2, "("&LEFT(D2,3)&") "&MID(D2,4,3)&"-"&RIGHT(D2,4)&IF(E2="", "", " x"&E2))

LEFT, MID and RIGHT cut the digits into area code, prefix and line number and glue the punctuation around them. The IF(LEN(D2)<>10, C2, …) part is the safety net: a blank cell stays blank, and a number that is not exactly 10 digits after cleaning (row 9, or a foreign number) is shown exactly as typed instead of being forced into the wrong shape. Here is the result:

RowC: PhoneD: DigitsE: ExtF: FormattedG: Same phone?
2(555) 010-12345550101234(555) 010-1234Same phone
3555.010.23455550102345(555) 010-2345Same phone
4+1 555-010-12345550101234(555) 010-1234Same phone
555501034565550103456(555) 010-3456
6555-010-4567 ext. 12555010456712(555) 010-4567 x12Same phone
7(blank)
81 (555) 010-23455550102345(555) 010-2345Same phone
9010-56780105678010-5678
10555 010 4567 x15555010456715(555) 010-4567 x15Same phone
11(blank)

To find the rows that need a human, add a check column:

=IF(AND(C2<>"", LEN(D2)<>10), "Check", "")

Only row 9 is flagged: 010-5678 has 7 digits, so the area code is missing and no formula can guess it.

All in one formula

If you would rather not keep helper columns, this does steps 1 to 3 for the whole range in one cell (adjust C2:C11 to your data):

=MAP(C2:C11, LAMBDA(p, LET(raw, p&"",
  ext, IFERROR(REGEXEXTRACT(raw, "(?i)(?:x|ext\.?|extension)\s*(\d+)\s*$"), ""),
  d0, REGEXREPLACE(REGEXREPLACE(raw, "(?i)\s*(x|ext\.?|extension)\s*\d+\s*$", ""), "\D", ""),
  d, IF(AND(LEN(d0)=11, LEFT(d0,1)="1"), RIGHT(d0,10), d0),
  IF(LEN(d)<>10, p, "("&LEFT(d,3)&") "&MID(d,4,3)&"-"&RIGHT(d,4)&IF(ext="", "", " x"&ext)))))

MAP runs the LAMBDA once for each cell in the range, so every row gets the same treatment as the three helper columns above.

Replace the original numbers

Formulas recalculate from column C, so to make the cleanup permanent, select F2:F11, copy, click C2 and use Edit › Paste special › Values only. Then delete the helper columns. Do this on a copy of the tab first if the list matters (right-click the tab and choose Duplicate).

Alternative: keep numbers as numbers and use a custom number format

If every phone is a plain 10-digit number, you can leave the values alone and change only how they look. Turn the cleaned digits into real numbers with

=IF(LEN(D2)=10, VALUE(D2), "")

paste them as values, select the column and choose Format › Number › Custom number format. Enter this pattern and click Apply:

"("000") "000"-"0000

In Google’s number format help page, 0 stands for a digit that is always shown and text in double quotes is added as typed, so 5550103456 is displayed as (555) 010-3456 while the cell still holds the number. That is handy for sorting, but it has limits: a format cannot show an extension, it does nothing to cells that hold text, and any formula that reads the cell sees 5550103456, not the formatted text. For a contact list you plan to export or mail-merge, the text version from Step 3 is usually the safer choice.

International numbers

Everything above assumes North American numbers. Other countries use different lengths and groupings, and their leading 0 or + matters. Three practical rules:

Step 4: use the clean column to find duplicate contacts

Now that every number has one spelling, duplicates are easy to see. Flag every row whose number appears more than once (G2, filled down):

=IF(D2="", "", IF(COUNTIF($D$2:$D, D2)>1, "Same phone", ""))

Rows 2 and 4 (Ana, two different emails), rows 3 and 8 (Ben) and rows 6 and 10 (the shared office line) are flagged. The D2="" test keeps the two blank phones from matching each other; the ignore blank cells guide explains why that matters. To mark only the later copies, so the first row of each group stays unmarked, use a running range instead:

=IF(D2="", "", IF(COUNTIF($D$2:D2, D2)>1, "Duplicate", ""))

To color whole rows instead, select A2:G, choose Format › Conditional formatting, pick Custom formula is and enter:

=AND($D2<>"", COUNTIF($D$2:$D, $D2)>1)

Decide whether the extension is part of the identity

Dev (ext. 12) and Gus (x15) share an office number, but they are different people. If extensions separate people in your list, match on a key that includes it:

=IF(D2="", "", D2&IF(E2="", "", "x"&E2))

With this key in column H, only rows 4 and 8 are later copies. In general, a shared number (an office switchboard, a family landline) is a hint, not proof, so review flagged rows with the name and email before you delete anything.

Remove the duplicates

Paste the key column as values (Edit › Paste special › Values only), sort so the row you want to keep comes first, then select the table and choose Data › Data cleanup › Remove duplicates, ticking only the key column. It keeps the first row of each group. Blank keys count as equal to each other, so in this example it would also delete Hana’s row as a “duplicate” of Eli’s: give blank rows their own key first, as shown in the ignore blank cells guide, or remove those rows by hand from a filtered view. If two copies hold different details (one has the email, the other the address), merge the rows instead of deleting one.

Keep new entries clean

To nudge people toward the clean format going forward, select C2:C, choose Data › Data validation, then Add rule, choose Custom formula is and enter:

=OR(C2="", REGEXMATCH(C2&"", "^\(\d{3}\) \d{3}-\d{4}( x\d+)?$"))

Under Advanced options, choose Show a warning rather than Reject the input, so a pasted or foreign number is still accepted but gets a red marker. For the setup details, see the prevent duplicate entries guide.

Common problems

FAQ

How do I format phone numbers in Google Sheets?

Clean first, then format. Keep only the digits with =REGEXREPLACE(C2&"", "\D", ""), drop a leading country code 1 when there are 11 digits, and build the display version with ="("&LEFT(D2,3)&") "&MID(D2,4,3)&"-"&RIGHT(D2,4). If the numbers are already plain 10-digit numbers, you can instead keep them as numbers and apply Format › Number › Custom number format with the pattern "("000") "000"-"0000.

How do I remove dashes, spaces, dots and parentheses from phone numbers in Google Sheets?

Use =REGEXREPLACE(C2&"", "\D", ""). \D matches any character that is not a digit, so (555) 010-1234, 555.010.1234 and 555 010 1234 all become 5550101234. The &"" turns a cell that holds a number into text first, because REGEXREPLACE only accepts text.

Why does REGEXREPLACE give an error on some phone numbers?

A phone number typed without punctuation, such as 5550103456, is stored as a number, and REGEXREPLACE only works with text input. Write C2&"" instead of C2 inside the formula and the error goes away.

How do I handle +1 and a leading 1 on US phone numbers?

After keeping only the digits, a US number with its country code has 11 digits starting with 1. =IF(AND(LEN(d)=11, LEFT(d,1)="1"), RIGHT(d,10), d) keeps the last 10 digits in that case and leaves everything else alone, so +1 555-010-1234 and 1 (555) 010-1234 end up the same as (555) 010-1234.

How do I keep phone extensions like ext. 12 or x12?

Split the extension off before you strip non-digits, or its digits are glued onto the number. =IFERROR(REGEXEXTRACT(C2&"", "(?i)(?:x|ext\.?|extension)\s*(\d+)\s*$"), "") returns just the extension, and the formatted number can add it back as " x12".

How do I find duplicate contacts by phone number in Google Sheets?

Compare the cleaned 10-digit column, not the original one. With the digits in D, =IF(D2="", "", IF(COUNTIF($D$2:D2, D2)>1, "Duplicate", "")) marks every later copy, and the conditional formatting rule =AND($D2<>"", COUNTIF($D$2:$D, $D2)>1) highlights all rows that share a number. Skip blank phone cells, and review shared lines such as an office main number before deleting anything.

Standardize the phone column without the formulas? SheetDupes (disclosure: we make it) is a Google Sheets add-on for duplicate rows and messy contact data. Its Standardize step rewrites a column in one go: choose the Phone column and US phone, and numbers like 555.010.2345, +1 555-010-1234 or 555-010-4567 ext. 12 become (555) 010-2345, (555) 010-1234 and (555) 010-4567 x12. Like the formulas above, it leaves anything that isn’t a 10-digit US number (or 11 digits starting with 1) as it was, and it copies a backup tab first. It refuses a sheet that contains formulas, so run it on the raw data, not next to helper columns. To find duplicate contacts, set the column’s match type to Phone (it is suggested from a header such as Phone or Mobile): numbers then match across formats and with or without a leading 1, and you preview the groups, highlight the extra rows, or remove or merge them. A number with an extension does not match the same number without one. Preview and Highlight are free on any size sheet; there is a 14-day free trial with no credit card, and writes remain free after the trial on sheets with up to 2,000 data rows during launch (through Jan 31, 2027; 500 after that). It only reads and writes the spreadsheet you have open, and your data is not sent to Loomwise. It is live on the Google Workspace Marketplace.
Install free from Google Workspace MarketplaceSee SheetDupes
Want to test it first? Try it on sample data (makes a copy of a 12-row example sheet in your Drive).

Related guides