What E.164 represents

An international E.164 number begins with a plus sign in its written representation, followed by the country calling code and national significant number. The digits identify a destination in the international public telecommunication numbering plan; spaces, parentheses and hyphens are presentation choices, not part of the canonical value.

For example, a US fixture displayed as (202) 555-0123 becomes +12025550123. A UK mobile fixture displayed as 07700 900123 becomes +447700900123 because the domestic trunk zero is removed before adding +44.

Normalize in four steps

  1. Capture country context. A national number alone is ambiguous. Ask for a country or infer it only from trusted account context.
  2. Parse with a maintained numbering library. Do not implement every national plan with hand-written string rules.
  3. Validate for the job you are doing. Structural validity, possible length, line type and reachability are different questions.
  4. Store the canonical value. Persist the normalized E.164 representation and format it for display when rendering the UI.

Try the browser-based E.164 formatter to compare national, international and RFC 3966 output.

Country calling codes and trunk prefixes

A country calling code is not always the same as the first digits users type domestically. Many national plans use a trunk prefix such as 0 for calls within the country. That trunk prefix is normally omitted from the international E.164 value. The exact rule belongs to the national numbering plan, which is why country context must be known before normalization.

North American Numbering Plan countries share +1, so the country code alone does not distinguish the United States from Canada. Use the full numbering plan and application context instead of treating +1 as a country identifier.

Storage and API design

Use a text column, not an integer. A phone number is an identifier: arithmetic is meaningless, the leading plus sign matters, and the value can exceed assumptions made for local numeric types. A practical record can store phone_e164, the user-selected region, validation timestamp and verification state separately.

Do not use formatting as proof of ownership. If your product must confirm control, run a separate consent-based verification flow and store that result with an expiry or audit timestamp.

Common implementation mistakes

  • Removing a leading zero before country context is known.
  • Rejecting spaces or punctuation instead of normalizing pasted input.
  • Using one regex for every country and every number type.
  • Assuming a structurally valid value is assigned or SMS-capable.
  • Formatting the stored value differently on each platform.

Standards and references

Use the current ITU-T E.164 recommendation for the international numbering model and IETF RFC 3966 for tel: URIs.