Company
Date Published
Oct. 23, 2024
Author
Alvaro Navarro
Word count
701
Language
English
Hacker News points
None

Summary

The E.164 international standard defines a phone number scheme that ensures each user worldwide has a unique phone number, simplifying international calls and reducing the risk of dialing the wrong number. The standard format is [country code] [national destination code] [subscriber number], with a maximum of 15 digits, where country codes are represented by prefixing them with a plus sign (+), national destination codes identify specific areas or networks within countries, and subscriber numbers are individual phone numbers assigned to users. Various examples illustrate how different countries' phone numbers can be represented in the E.164 format, including those for the US, UK, Spain, and Germany. The standard is used by many APIs, such as Vonage Network APIs, which require API consumers to follow this format when calling certain endpoints. To validate an E.164 phone number, developers can use existing libraries like phone or phonenumbers, or build their own validator using regular expressions.