Rate this page:

E.164 is the international telephone numbering plan that ensures each device on the PSTN has globally unique number.

This number allows phone calls and text messages can be correctly routed to individual phones in different countries. E.164 numbers are formatted [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.

Examples of E.164 Numbers

E.164 Format

Country Code


Subscriber Number













RegEx Matching for E.164

There are several occasions when you'll want to programmatically verify that a string is in a valid E.164 phone number. Some of these include:

  • capturing a user’s phone number in a form
  • sending a Twilio SMS or voice call
  • validating phone numbers in a database

According to the official ITU E.164 recommendation the format must be a number up to fifteen digits in length starting with a ‘+’. You can also exclude 0 as the first character since there are no country codes that start with 0. Here is a sample regular expression:


However, this will also match numbers that are not a valid phone number.

How to Validate a Phone Number

A far more complex set of patterns would need to be specified to match only valid E.164 numbers for all countries around the world. A simpler and more robust way to validate phone numbers is to use the Twilio Lookup API to perform phone number validation and formatting without the need for RegEx.

Rate this page:

Thank you for your feedback!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Sending your feedback...
🎉 Thank you for your feedback!
Something went wrong. Please try again.

Thanks for your feedback!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more