Phone numbers seem simple — a string of digits you dial to reach someone. In reality, phone number formatting is one of the most surprisingly complex areas of data validation. Different countries use different digit lengths, different separators, different dialing prefixes, and different conventions for mobile vs. landline numbers. Getting phone number formatting wrong causes failed calls, undelivered SMS messages, and frustrated users. This guide covers the international standards and practical techniques for handling phone numbers correctly.
The E.164 Standard
E.164 is the international standard for phone number formatting, maintained by the ITU (International Telecommunication Union). An E.164 number consists of a maximum of 15 digits and follows the format: +[country code][subscriber number]. The plus sign indicates that the number is in international format. There are no spaces, dashes, or parentheses in a strict E.164 number — just digits preceded by a plus sign.
For example: +14155552671 is the E.164 format for a US number (country code 1, subscriber number 4155552671). +447911123456 is a UK mobile number. E.164 is the format used by SMS APIs, VoIP systems, and databases that store phone numbers for international use. If you are building any system that handles phone numbers, storing them in E.164 format is the best practice.
Country Codes
Every country (and some territories) has a unique country code assigned by the ITU. Country codes range from 1 to 3 digits. Some notable examples: United States and Canada share +1, United Kingdom is +44, China is +86, Japan is +81, Germany is +49, India is +91, Australia is +61, and Brazil is +55. Some small countries share country codes (like the North American Numbering Plan countries sharing +1), while some large countries have multiple dialing codes within their national system.
Country codes are not the same as area codes. Country codes identify the country, while area codes (or national destination codes) identify regions within a country. In E.164 format, both are concatenated without any separator.
National vs. International Format
Phone numbers can be written in national format (for domestic use) or international format (for international use). National format includes the trunk prefix (usually 0) but not the country code. For example, a London number in national format is 020 7946 0958, but in international format it is +44 20 7946 0958 (note: the leading 0 is dropped when adding the country code).
This is a common source of errors: users often enter their number with the trunk prefix (like 07911 123456 for a UK mobile) but systems expect E.164 format (+447911123456). The conversion requires dropping the leading 0 and prepending the country code. Libraries like Google's libphonenumber handle this automatically.
Common Formatting Conventions
- United States: (XXX) XXX-XXXX — parentheses around area code, hyphen between prefix and line number
- United Kingdom: 0XXXX XXXXXX — space after the area code
- Germany: 0XXX XXXXXXXX — space after area code
- France: 0X XX XX XX XX — pairs of digits separated by spaces
- Japan: 0X-XXXX-XXXX — dashes between segments
- China: 1XX-XXXX-XXXX (mobile) or 0XX-XXXXXXXX (landline)
Validating Phone Numbers
Phone number validation is harder than it looks. A naive approach (checking length and allowed characters) catches obvious errors but misses many invalid numbers. A proper validation library like Google's libphonenumber knows the valid length ranges and formats for every country, can distinguish between landline and mobile numbers, and can identify numbers that are syntactically valid but not actually assigned. RiseTop's phone number formatting tool uses these validation rules to verify numbers and format them correctly for any country.
Using RiseTop's Phone Number Formatter
RiseTop's phone number tool accepts numbers in any common format — with or without country code, with various separators, with or without parentheses — and converts them to your chosen output format. Select the target country to auto-detect the correct formatting convention, or choose E.164 for a standardized output. The tool validates the number and warns if it appears invalid for the selected country.