International Phone Number Formats Guide

Understand E.164, country codes, area codes, and the rules behind valid phone numbers.

What is E.164?

E.164 is the international standard for phone numbers. It defines a maximum length of 15 digits and a format that includes a country code and a national subscriber number. E.164 is widely used for VoIP, telecom systems, and international communication standards.

If you store numbers in a database, E.164 is the safest canonical format because it is globally unique and unambiguous. It removes formatting differences like spaces, dashes, and parentheses. As a result, E.164 is the format most telecom APIs and authentication providers expect.

+CountryCode NationalNumber

Example: +1 415 555 2671

E.164 vs E.123

E.123 describes how phone numbers are displayed to humans. It focuses on spacing, grouping, and readability, while E.164 focuses on a strict canonical representation for systems. A number can be valid in both formats, but the display rules differ by country.

In practice, you should accept a variety of user input styles, normalize to E.164 for storage, and then format back to an E.123 style for display. This approach keeps both machines and humans happy.

Country Codes vs Area Codes

Country codes identify the country or region. Area codes (or national destination codes) identify a specific geographic area or service type within a country.

Country codes are 1 to 3 digits. The numbering plan is managed by the ITU, and no country code is a prefix of another within its zone. That helps international switching systems route calls without ambiguity.

  • Country Code: The international dialing prefix (e.g., US +1, UK +44, Japan +81)
  • Area Code: Regional or service-specific code within the country (e.g., 415 for San Francisco in the US)

National Numbering Plans

Each country defines its own national numbering plan. This plan determines how many digits are used, which prefixes are reserved for mobile, landline, toll-free, or premium services, and how numbers are grouped for readability.

Some countries use closed numbering plans where all national numbers have the same length. Others use open numbering plans where lengths vary by region or service. When generating test numbers, you should respect these rules to avoid creating unrealistic data.

Trunk Prefixes and International Dialing

Many countries use a trunk prefix (often 0) for domestic dialing. The trunk prefix is not part of the E.164 number. When users enter numbers, they may include this prefix, so your validation logic should normalize it out before comparing to E.164 patterns.

International dialing prefixes vary by country (for example 00 in many regions or 011 in the US and Canada). These prefixes are also not part of E.164 and should be stripped during normalization.

Mobile vs Landline Formats

Many countries use different prefixes for mobile and landline numbers. For example, the UK uses mobile ranges that start with 7, while landlines have geographic prefixes. Understanding these patterns is essential for realistic test data.

Our generator includes both mobile and landline formats where applicable, and you can reference the country-specific pages for detailed prefixes and examples.

Extensions and Subaddressing

Extensions are common in enterprise environments. They are not part of E.164, but users often type them alongside a main number (for example, "x123" or "ext 123"). When parsing user input, extract extensions into a separate field.

Some systems use subaddressing or SIP parameters, which should also be handled separately. Keep the core phone number clean and store auxiliary routing information in dedicated fields.

Best Practices for Validation

  • Always normalize input to E.164 before validation.
  • Use a trusted library (e.g., Google libphonenumber) for real-world validation.
  • Check for valid length, prefix, and numbering plan rules.
  • Be flexible with user input (spaces, hyphens, parentheses).

Validation should be a multi-step process. First, parse and normalize. Second, detect a country based on prefix and length. Third, validate the national number against known ranges. Finally, format for display and return structured metadata like number type and region.

Formatting Conventions

Formatting rules vary by country. Some regions group numbers in pairs, while others use 3-3-4 or 2-4-4 patterns. Consistent formatting improves readability, especially in user interfaces and contact lists.

  • Use spaces for readability instead of hyphens when possible.
  • Avoid parentheses in storage; apply them only in display formats.
  • Keep formatting consistent across your product to reduce confusion.

Parsing and Normalization Pipeline

A robust parser handles multiple user input styles. Start by removing whitespace and punctuation, then detect a leading plus sign or international access code. Once you have a candidate country code, validate the remaining digits against that country's numbering plan and map it to a national significant number.

Normalization is essential for data quality. Store a single canonical value (E.164) and compute any display formatting dynamically. This prevents data drift when users edit their number or when numbering plans evolve.

International Dialing Examples

International dialing prefixes are not part of E.164 but appear in user input. For example, a user in the US might dial 011 44 20 7946 0958 to reach London, while a user in Europe might dial 00 1 415 555 2671 to reach San Francisco. Your parsing logic should strip these prefixes and retain only the country code and national number.

Users often mix local and international formats. That is why you should accept a broad set of input styles and normalize internally. Rejecting a number because it does not match a strict formatting mask is a common source of failed signups.

Common Mistakes in Formatting

  • Removing the leading plus sign from E.164 numbers.
  • Storing numbers with local trunk prefixes included.
  • Assuming every country has the same length.
  • Rejecting valid user input because of spaces or punctuation.
  • Mixing country codes with local formats without normalization.

A robust validation pipeline accepts multiple input styles but stores a single normalized form. This avoids data quality problems when you later integrate with SMS, voice, or verification services.

Validation for SMS and Voice

Many services require E.164 input for outbound messages and calls. If your application validates only the local format, you may still fail when you hand the value to a provider. Always validate at the E.164 level and store the normalized output, then map it back for display.

When testing, include numbers from multiple regions and service types (mobile, landline, toll-free). This ensures your formatting and validation logic handles realistic datasets.

Common Examples

+1 415 555 2671

United States

+44 20 7946 0958

United Kingdom

+81 3 1234 5678

Japan

+86 10 8888 6666

China

These examples are formatted for readability. Your backend should store the same numbers in strict E.164 (for example, +14155552671) while rendering a localized version for UI.

Recommended Workflow for Developers

  1. Collect input: Accept multiple formats and remove punctuation.
  2. Normalize: Convert to E.164 and store that version in your database.
  3. Validate: Use a library with official numbering plan data.
  4. Display: Format for the user based on country conventions.
  5. Test: Use realistic, country-specific test data in staging.

If you need test data, try the phone number generator or the bulk generator. For validation, use the validator to verify format rules before storing data.

Glossary

  • E.164: ITU standard for international numbering.
  • E.123: ITU recommendation for human-readable formatting.
  • NSN: National Significant Number (country code excluded).
  • NDC: National Destination Code, often the area code.
  • Subscriber Number: The local number assigned to the user.