Skip to content

Help center

How to format phone numbers to E.164 in Google Sheets

Convert phone numbers to E.164 in Google Sheets with REGEXREPLACE and ARRAYFORMULA: strip punctuation, add the country code, drop trunk zeros, flag bad rows.

Updated 2026-11-23

In Google Sheets, REGEXREPLACE removes everything that is not a digit, and a second formula adds the country code and drops the domestic zero. ARRAYFORMULA fills the whole column from one cell. Do one country per column, and treat the result as correctly shaped, not as proven valid.

E.164 is a +, the country calling code and the national number, with no spaces or punctuation, at most 15 digits.

Steps in Google Sheets

Put the raw numbers in column A with a header in row 1. Select column A and choose Format, Number, Plain text before pasting.

  1. Digits only. In B2:
=ARRAYFORMULA(IF(A2:A="","",REGEXREPLACE(TO_TEXT(A2:A),"[^0-9]","")))
  1. Build E.164 for the US and Canada (+1). In C2:
=ARRAYFORMULA(IF(A2:A="","",IF(LEFT(TRIM(TO_TEXT(A2:A)),1)="+","+"&B2:B,IF(LEN(B2:B)=10,"+1"&B2:B,IF((LEN(B2:B)=11)*(LEFT(B2:B,1)="1"),"+"&B2:B,"CHECK")))))

It keeps numbers that already start with +, adds +1 to 10 digits, accepts 11 digits starting with 1, and writes CHECK otherwise.

  1. A country with a leading zero. For United Kingdom numbers like 07400 123456, use this in C2 instead:
=ARRAYFORMULA(IF(A2:A="","",IF(LEFT(TRIM(TO_TEXT(A2:A)),1)="+","+"&B2:B,IF(LEFT(B2:B,1)="0","+44"&MID(B2:B,2,20),"CHECK"))))

MID(B2:B,2,20) removes the first character, the domestic trunk prefix. Swap +44 for your country's code, such as +33 for France or +49 for Germany.

  1. Flag odd lengths. In D2:
=ARRAYFORMULA(IF(A2:A="","",IF((C2:C<>"CHECK")*(LEN(C2:C)>=9)*(LEN(C2:C)<=16),"ok","check")))

The plus sign counts as one character, so 16 is the limit for 15 digits. Filter column D for check. 5. Freeze the values. Copy column C and use Edit, Paste special, Values only into a new column, then delete the formula columns.

If you need to run only one cell rather than the column, drop ARRAYFORMULA and the range markers, and use A2 and B2 as in the Excel version.

Worked example

Take four raw values in column A: (201) 555-0123, 201.555.0123, 1-201-555-0123 and 555-0123. Column B holds 2015550123, 2015550123, 12015550123 and 5550123. With the US formula, column C reads +12015550123 for the first three, and CHECK for the last, because seven digits carry no area code. The first two rows are the same number written differently, so a duplicate check on column C now finds them. That is the main payoff of E.164: one number, one string.

To remove duplicates, select column C and use Data, Data cleanup, Remove duplicates, or use =UNIQUE(C2:C) in a new column. Always do it on the E.164 column, never on the raw one, or (201) 555-0123 and 201.555.0123 survive as two contacts.

Check validity with the API

A formula cannot know which number ranges a country has opened. The phone endpoint can, and it also returns the line type:

bash
curl https://api.qelka.com/v1/phone \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone": "07400 123456", "country": "GB"}'

Read status, e164 and line_type. For a whole sheet, choose File, Download, Comma-separated values, then upload the file as a bulk job with type=phone, the column header and a country. The result file adds result_status, result_e164 and result_line_type. Basic checks cost 1 credit per row. Clean a phone number list covers what to do with each result.

Common mistakes

  • Pasting into an automatic column. Sheets turns 0740... into a number and drops the zero. Use Plain text first.
  • Mixing countries. Split rows by country, one formula per country.
  • Leaving the trunk zero after the code. +4407400123456 is wrong.
  • Putting ARRAYFORMULA in a cell with data below it. The sheet shows #REF!. Keep the cells below C2 empty.
  • Reading ok as valid. It is a length check.

Frequently asked questions

What formula removes spaces and dashes from phone numbers in Google Sheets?
Use =REGEXREPLACE(TO_TEXT(A2),"[^0-9]",""). It deletes every character that is not a digit, including spaces, hyphens, dots, parentheses and the plus sign. TO_TEXT makes sure a number stored as a number is read as text first. Wrap it in ARRAYFORMULA to fill a whole column from a single cell.
How do I keep the leading zero and plus sign in Google Sheets?
Select the column and choose Format, Number, Plain text before you paste. Sheets then keeps 07400 123456 and +44 7400 123456 as typed. A cell typed with a leading plus may be read as a formula otherwise. If the zero is already gone, the original digits are lost, so paste again from the source into a plain text column.
Can Google Sheets check that a phone number really exists?
No. A formula can check length and first characters, which catches typos. Whether a number exists depends on the numbering plan of its country. Export the sheet as CSV and run it through a bulk phone job, which returns valid or invalid, E.164 and line type for each row.

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.

  • 100 free credits a month
  • No card
  • Test keys spend nothing
  • Cancel any time