Phone numbers are among the messiest data you will ever handle. The same London number might be written 020 7946 0958, +44 20 7946 0958, 0044 (0)20 7946 0958 or +442079460958. Contact pages, email signatures, event sign-up sheets and old spreadsheets mix all of these, and when you import them into a CRM, a dialler or a messaging tool, inconsistent formats cause failed calls and duplicate contacts.
This guide explains how phone numbers are structured, why automatic detection is always a best guess, what the E.164 format is and why systems prefer it, and how to extract and normalise numbers in a browser, a spreadsheet or with a script.
How phone numbers are built
Internationally, a phone number has up to three parts:
- Country code: 1 for the US and Canada, 44 for the UK, 49 for Germany, 91 for India, and so on.
- Area or network code: identifies a region or mobile network in many countries.
- Subscriber number: the rest.
When dialling within a country, many countries add a trunk prefix, usually 0, in front of the area code. That is why a UK number is written 020… domestically but +44 20… internationally: the 0 is dropped once the country code is added. When dialling internationally, the international prefix (00 in many countries, 011 from North America) or the + symbol comes first.
The E.164 format
E.164 is the international standard numbering plan. In its written form, a number is:
+[country code][national number] e.g. +442079460958
No spaces, no brackets, no trunk 0, and at most 15 digits. Because there is only one way to write each number, E.164 is what many CRMs, SMS gateways and calling platforms ask for, and it makes duplicates easy to spot.
The trunk-prefix exception
Removing the leading 0 works for most countries, but not all. Italian landlines, for example, keep their leading 0 after the country code. If your data includes such countries, check the converted numbers, or convert them with a library that knows each country's rules.
Why detection is always a best guess
Text is full of digit sequences that are not phone numbers:
- Dates:
2025-03-14,14/03/2025 - IP addresses:
192.168.10.254 - Prices and decimals:
1,299.00 - Times:
14:30 - Order numbers, postcodes and IDs
A pattern-based extractor looks for runs of digits with typical phone separators (spaces, dashes, dots, brackets and slashes), requires a minimum number of digits, caps the total at 15 (the E.164 maximum) and rejects common look-alikes. That catches most real numbers, but it cannot know for certain that a 10-digit reference is not a phone number. Always review the output.
Extract and normalise phone numbers in your browser
Our Phone Number Extractor does the detection on your device.
- Open Phone Number Extractor and paste into Text containing phone numbers. The Sample mixes UK, US, German, Australian and Indian numbers with a date, an IP address, a price and a ZIP code that should be ignored.
- Choose an Output style:
- As written keeps each number exactly as it appeared.
- Digits only (keep +) strips separators, keeping
+for international numbers. - E.164 (+CountryNumber) normalises to
+plus digits.
- For E.164, enter a Default country code, such as 44 or 1. Numbers written without
+or00get this code and lose one leading 0. Numbers that already have+or00keep their own code. - Set Minimum digits (default 7). Raise it if short codes or extensions are being picked up; lower it for short local numbers.
- Choose Separate with, for example One per line, and keep Remove duplicates on so the same number written in different ways counts once.
- Review the list. The summary reminds you that detection is pattern-based. Then Copy or Download.
Other ways to clean phone numbers
Spreadsheets
To strip everything except digits in Google Sheets:
=REGEXREPLACE(A2, "[^0-9+]", "")
Then build E.164 with a formula that adds the country code and removes a leading 0, for example ="+44"&MID(B2,2,20) for UK numbers starting with 0. This is effective when all numbers come from one country and sit one per cell. It gets complicated fast with mixed countries.
Phone number libraries
For production systems, use a dedicated library such as Google's open-source libphonenumber (available for Java, JavaScript and other languages through ports). It knows each country's numbering rules, validates number lengths and handles trunk prefixes correctly. If you are building an import pipeline, this is the right tool; a browser extractor is ideal for one-off clean-ups.
Your CRM's import options
Many CRMs and messaging platforms can normalise numbers during import if you set a default country. Check the import settings before converting manually.
Tips and pitfalls
Extensions
Extensions such as ext. 204 are not part of the dialable number and are ignored. If you need them, keep the original text alongside the extracted numbers.
The (0) in UK-style numbers
Numbers written +44 (0)20 7946 0958 include the trunk 0 in brackets as a hint for domestic callers. It should not be dialled after +44. Check such numbers after conversion, and remove the (0) with Find and Replace first if your data uses this style often.
Mixed contact details
Signatures and contact pages usually contain emails and web addresses too. The Email Extractor and URL Extractor pull those out in the same way. If you need all digit sequences rather than phone-shaped ones, use the Number Extractor.
Personal data
Phone numbers are personal data in many jurisdictions. Only collect and use them for purposes people would expect, and follow the rules on calling and messaging that apply where you and your contacts are.
Frequently asked questions
What is E.164 format?
E.164 is the international phone numbering standard. Written numbers start with + and the country code, followed by the national number with no spaces or trunk 0, up to 15 digits in total, such as +442079460958.
How do I add a country code to local numbers?
Choose E.164 and enter a Default country code. Numbers without + or 00 get that code, and one leading 0 is removed.
Why were some numbers in my text not found?
They may have fewer digits than the Minimum digits setting, more than 15 digits, or look like a date, time, IP address or price. Lower the minimum or reformat those numbers and try again.
Can the extractor tell if a number is real?
No. It finds text shaped like a phone number. It cannot check whether the number exists or is in service, so review the results before importing.
Why does E.164 conversion remove the leading zero?
In most countries the 0 is a trunk prefix used only for domestic dialling and is dropped when the country code is added. Some numbers, such as Italian landlines, keep it, so check those manually.