E.164 is an international standard that defines a format for telephone numbers used worldwide. This standard ensures that every phone number is unique and that calls and messages can be correctly routed to phones worldwide.
The E.164 standard, also known as the International Public Telecommunications Numbering Plan, was first approved and published in May 1997. Numbers that use the E.164 standard are formatted [+] [country code] [subscriber number including area code] and can have a maximum of fifteen digits.
E.164 enables seamless communication across borders using a common system that all countries have adopted. This standard helps telecommunication networks direct calls accurately. It also provides a standardized format for storing and processing phone numbers, which is relevant for cloud communications tools like Plivo.
Understanding the structure of E.164 format
There are four components of the E.164 format:
- A + (plus) sign
- International Country Calling code
- Local Area code
- Local Phone number
Phone numbers can be a maximum of fifteen digits long. You can find the list of international country calling codes here. Here are some examples of E.164 numbers globally.
United States: +1 (212) 555-1212
- +1: Country code for the United States
- (212): Area code for New York City
- 555-1212: Subscriber number
United Kingdom: +44 20 7123 4567
- +44: Country code for the United Kingdom
- 20: Area code for London (note: not all UK numbers have an area code)
- 7123 4567: Subscriber number
Germany: +49 30 1234567
- +49: Country code for Germany
- 30: Area code for Berlin (not all German numbers have area codes)
- 1234567: Subscriber number
Singapore: Due to Singapore's small size, there are no area codes. All Singapore phone numbers consist of eight digits. For example, +65 6123 4567:
- +65: Country code for Singapore
- 6123 4567: Subscriber number
Validating E.164 formatted numbers
It’s important to make sure numbers are properly formatted in E.164 to reduce the risk of fraud and make sure the intended audience receives your messages. Basic validation checks should ensure the number is no longer than 15 digits, starts with a plus sign, and uses a valid country code.
You can use RegEx to filter out invalid numbers before applying more sophisticated validation methods. A simple RegEx pattern to match most E.164 numbers is ^\+[1-9]\d{1,14}$
Breakdown:
- ^: Matches the beginning of the string.
- \+: Matches a literal plus sign.
- [1-9]: Matches a single digit from 1 to 9 (to prevent leading zeros).
- \d{1,14}: Matches one to fourteen digits.
- $: Matches the end of the string.
RegEx is ideal as an initial screening step to perform basic validation. We recommend using Plivo’s Number Lookup API as a more sophisticated option. Our API can determine the carrier, number type, format, and country for any phone number worldwide. Learn more at https://www.plivo.com/lookup/.