By Arkay · Updated
How do you use the phone number validator?
Choose a default country, paste your numbers, and read each result. The default country applies only to numbers written without a country code.
- Choose a default country for numbers that have no country code.
- Paste one or more phone numbers, one number per line.
- Read the result for each number. It says whether the number is valid, and why.
- Check the country and the number type, where the tool knows them. Types include mobile, landline, toll-free and VoIP.
- Copy the result in the format you need.
- For a long list, download the bulk results as a CSV file.
Each step matches one of the tool's inputs or outputs. Use the CSV download when you check many numbers, so the results can sit alongside the rest of your data.
How does the phone number validator work?

This tool uses Google's libphonenumber metadata through libphonenumber-js, a simpler and smaller JavaScript rewrite of the library.
It works in three steps. It parses the number against the default country, checks it against that country's number lengths and ranges, and then formats it. All three steps run in your browser, and numbers are not sent anywhere.
A valid result means the number fits a real numbering range. It does not mean that the line is in service, or who owns it. For example, with the default country set to the United Kingdom, a UK number is converted to E.164 form, such as +442071838750, the UK example that Twilio uses.
The tool's two checks are different. libphonenumber's isPossibleNumber guesses whether a number is possible using only its length. isValidNumber does full validation for a region, using length and prefix information. A number can pass the length test and still fail the prefix test, so a check that stops at length will accept some numbers that a full check rejects.
What is E.164 format?
E.164 is the numbering plan published by the ITU-T, titled The international public telecommunication numbering plan. An E.164 number is a plus sign followed by digits only. The libphonenumber README shows a Swiss number in this form, +41446681800.
Twilio's glossary describes an E.164 number the same way. It starts with a plus sign, has at most 15 digits in total, and does not start with 0. The part after the country code can be at most 15 minus the length of the country code.
Twilio's examples are +14155552671, for the United States with country code 1 and area code 415, and +442071838750, for Great Britain with country code 44.
How to write numbers on paper and screens is a separate standard. ITU-T E.123 covers the notation for national and international telephone numbers.
Treat the 15-digit limit as the rule, with one known exception. libphonenumber's maintainers note that the ITU-T specifies a maximum of fifteen digits, but valid numbers in Germany have been assigned that are longer than this. Check length with a library, not by counting digits by hand. The country code is the part that tells you which country's rules apply, so check it first when a number looks wrong.
How do country codes and trunk prefixes work in the US, UK, Canada and India?
In international format, the country code follows the plus sign, and the national leading 0 is dropped. Twilio says an E.164 number does not start with 0, so the leading 0 of a UK number goes once +44 is added.
The table gives an example for each country.
| Country | Country code | Example |
|---|---|---|
| United States | 1 | +14155552671, area code 415 (Twilio) |
| United Kingdom | 44 | +442071838750 (Twilio) |
| Canada | 1 | Shares code 1 with the United States |
| India | 91 | Written +91 |
The ITU's list of national numbering plans shows Canada and the United States both using code 1. The same code also covers Caribbean countries, such as the Bahamas (1 242) and Barbados (1 246). So code 1 alone does not tell you the country. The digits after the 1 do that work.
Twilio's US example shows the structure. In +14155552671, the 1 is the country code, 415 is the area code, and the rest is the subscriber part. Twilio describes the subscriber part as at most 15 minus the length of the country code, so the country code uses up part of the 15-digit total.
For sample UK numbers, use a safe range. In the UK, Ofcom sets numbers aside for TV and radio drama, including mobile numbers 07700 900000 to 900999, so these are safe to use as examples.
How do you convert a local number to international format?

Start with the number as it was written, and the default country for it. Then work through four steps.
- Remove spaces, brackets and dashes.
- If the number starts with 0, remove the 0, because E.164 numbers do not start with 0.
- Add the plus sign and the country code in front.
- Check the result with the validator, using the default country for that number.
Take the UK example first. Twilio's E.164 form for a UK line is +442071838750. The 44 is the country code, and the 20 after it is the national destination code. The 0 that a UK number starts with is not kept in the E.164 form. So do I keep the leading 0 when I add +44? No. Once +44 is in front, the 0 goes.
The US example, +14155552671, is already in E.164 form, so it needs no conversion. Reading it shows the pattern: the country code 1 comes first, then the area code 415, then the rest of the number.
The tool does similar work when you set a default country. It reads a number without a country code against that country. It still shows whether the result is valid, and why, so check the output before you use it.
How do E.164, international, national and tel: formats compare?
The libphonenumber README shows one Swiss number in three formats. The table adds the tel: form from RFC 3966.
| Format | Example | Notes |
|---|---|---|
| E.164 | +41446681800 | Plus sign and digits only (Switzerland, CH) |
| International | +41 44 668 18 00 | Spaces make it easier to read (CH) |
| National | 044 668 18 00 | Keeps the national 0 (CH) |
| RFC 3966 tel: | tel:+1-201-555-0123 | Hyphens, dots and brackets allowed; no spaces |
Choose the form by where the number goes. Storage and matching work best with E.164, while people reading a page can use the international form.
RFC 3966 defines the tel: URI. Globally unique numbers start with a leading plus sign, and the RFC's example, tel:+1-201-555-0123, points to a number in the United States. Visual separators are allowed, but spaces are not, so copy the tel: form from the tool and not the spaced form.
The RFC also says implementations must not assume that telephone numbers have a maximum, minimum or fixed length. Validate with a library rather than a fixed digit count.
How should you format numbers for CRMs, SMS APIs and WhatsApp?
Use one format for every record. The E.164 form is a good one to store, because it carries the country code and has no spaces or punctuation to clean up later. Keep the country code with every stored number, because a number without it depends on a default country that someone has to remember. If your team prefers to show the national or international form, keep E.164 in the field that your SMS tool reads, if the tool documents that format.
WhatsApp's click to chat rule is to use https://wa.me/ followed by the full number in international format, with any zeroes, brackets or dashes omitted. WhatsApp shows https://wa.me/1XXXXXXXXXX as correct and https://wa.me/+001-(XXX)XXXXXXX as wrong. The correct link has no plus sign.
A simple routine for a CRM or a list:
- Remove spaces, dashes and brackets, using the formulas in the Excel section below.
- Check each number with the validator, and note the default country you used.
- Save the E.164 form, and keep the original only if your team needs it.
How do you clean phone numbers in Excel and Google Sheets?

Excel automatically removes leading zeros, and converts large numbers to scientific notation, like 1.23E+15. A UK list that starts with 0 can lose that 0 before you clean it.
Excel's maximum precision is 15 significant digits. E.164 also caps a number at 15 digits. The two limits match, but they are different rules from different sources. Storing numbers as text means Excel does not treat them as numbers at all, so its precision limit does not apply.
Format the column as Text before you paste the numbers. Microsoft notes that this keeps leading zeros, but does not restore zeros removed before the column was formatted. If the zeros are already gone, fix the source list first.
To remove spaces, dashes and brackets, use SUBSTITUTE, which has the syntax SUBSTITUTE(text, old_text, new_text, [instance_num]). Without instance_num, it changes every occurrence of old_text. This formula cleans the number in cell A2:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2," ",""),"-",""),"(",""),")","")
To keep only digits and the plus sign, use REGEXREPLACE in Excel for Microsoft 365. Microsoft lists REGEXREPLACE for that version only, and it uses the PCRE2 regex flavor. It replaces all instances by default:
=REGEXREPLACE(A2,"[^0-9+]","")
Google Sheets has its own REGEXREPLACE, which uses RE2 regular expressions. The same pattern works there. The function only works with text, not numbers, so format the column as plain text first:
=REGEXREPLACE(A2,"[^0-9+]","")
These formulas strip formatting only. They do not check that a number is real, so paste the cleaned numbers into the validator next.
Can a validator tell a mobile from a landline, or whether a number is in use?
A validator can often tell the number type, but it cannot tell you whether the number is in use. libphonenumber's getNumberType can distinguish fixed-line, mobile, toll-free, premium rate, shared cost, VoIP and other types, whenever feasible. This tool shows the type where it is known.
In the UK, Ofcom says area codes all start with 01 or 02. Numbers that start with anything else are not linked to an area.
A validator also cannot tell you who owns a line or its carrier. libphonenumber does not provide data about the current carrier of a phone number.
Numbers change hands. Old phone numbers are recycled and reassigned to other people, so a number that connects today may be disconnected tomorrow. For that reason, libphonenumber's maintainers advise against storing properties of a number, such as its validity or type.
When you record a check, write down the date and the default country you used, rather than a permanent label such as valid or mobile. Treat a valid result as a sign that the number fits a real range. To know whether a line is in use, you need a different check, and only then should you call it in use.
More guides in Virtual Phone Numbers.
Related guides
Frequently asked questions
- Is there a regex for E.164, and is it enough to validate a number?
- A regular expression can check the shape: a plus sign, then a first digit that is not zero, then digits only, with no more than 15 digits in total. Twilio notes that a regular expression cannot guarantee a match with a valid number, so validate with a library such as libphonenumber-js.
- How should I write my phone number on a CV for international employers?
- Use the international format from the table above, with the plus sign and the country code, such as +41 44 668 18 00 for a Swiss number. The country code tells an employer in another country which country the number belongs to.
Sources
- libphonenumber-js is a simpler and smaller rewrite of Google's libphonenumber library in J (gitlab.com)
- ITU-T Recommendation E.164 is titled 'The international public telecommunication numbering (www.itu.int)
- In libphonenumber, isPossibleNumber guesses whether a number is possible using only length (github.com)
- Twilio describes an E.164 number as starting with a +, limited to a total of 15 digits, an (www.twilio.com)
- ITU-T Recommendation E.123 covers notation for national and international telephone number (www.itu.int)
- libphonenumber's maintainers note that ITU-T specifies a maximum of fifteen digits, but va (github.com)
- The ITU's list of national numbering plans shows Canada and the United States sharing coun (www.itu.int)
- In the UK, Ofcom sets aside numbers for TV and radio drama, including mobile numbers 07700 (www.ofcom.org.uk)
- RFC 3966 defines the tel URI; globally unique numbers are identified by a leading +, and t (www.rfc-editor.org)
- WhatsApp's click to chat uses https://wa.me/<number>, where the number is a full phone num (faq.whatsapp.com)
- Excel automatically removes leading zeros and converts large numbers to scientific notatio (support.microsoft.com)
- Excel's SUBSTITUTE function has the syntax SUBSTITUTE(text, old_text, new_text, [instance_ (support.microsoft.com)
- Excel's REGEXREPLACE function has the syntax REGEXREPLACE(text, pattern, replacement, [occ (support.microsoft.com)
- Google Sheets' REGEXREPLACE has the syntax REGEXREPLACE(text, regular_expression, replacem (support.google.com)
- In the UK, Ofcom says area codes all start with 01 or 02, and numbers starting with anythi (www.ofcom.org.uk)