Skip to content
ZeroServer.tools

Phone Number Formatter

Format phone numbers to E.164, national, or international format — auto-detects country code.

Enter digits with or without formatting

Raw Digits: 0Output Length: 0

Phone number format standards

E.164 is the international standard: a leading +, country code, and subscriber number with no spaces or punctuation (e.g. +15558675309). It's the format required by most telephony APIs. National format uses local conventions (e.g. (555) 867-5309 for the US).International format adds the country code with spaces for human readability.

To validate email addresses, use the Email Validator. To encode phone URIs, see URL Encoder.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Normalising numbers from a spreadsheet into E.164 before importing them into a messaging system.
  • Formatting a number for display in the local convention of its own country.
  • Checking whether a number has a plausible country code and length.
  • Cleaning up numbers entered by users with assorted spacing and punctuation.
  • Converting a national format into the international one for an API.

Frequently Asked Questions

What is E.164 and why does it matter?
The international standard: a + sign, country code and number, maximum 15 digits, no spaces or punctuation. It is the only unambiguous form, which is why every SMS API and CRM expects storage in E.164.
Why can't a regex validate phone numbers?
Because numbering plans differ by country and change — lengths vary, area codes are added and retired, and mobile prefixes are reallocated. Real validation needs a maintained dataset like libphonenumber, not a pattern.
What happens to leading zeros?
They are a national-dialling prefix and are DROPPED in international format. UK 020 7946 0958 becomes +44 20 7946 0958 — keeping the zero is one of the most common formatting errors.
Why does formatting differ so much between countries?
Because grouping follows each country's dialling structure. France groups in pairs (01 42 68 53 00), the US in 3-3-4, and Germany varies by area code length. There is no universal grouping rule.
How should numbers be stored?
In E.164, formatted only for display. Storing formatted text means every consumer must parse it, and the same number stored two ways will not match — which is how duplicate contacts appear.
Why does a number need a region to be parsed?
Because a national number is ambiguous without one — the same digits are valid in several countries. Only an E.164 number carrying its country code is self-describing, which is why parsing libraries require a default region.
What is a national prefix and why is it dropped?
The trunk digit dialled domestically — the 0 in UK numbers, the 1 in North America. It is not part of the international form, so `020 7946 0000` becomes `+442079460000` with the 0 removed, not retained.

Common errors and gotchas

  • Assuming the country from the caller's locale rather than the number, which misparses any foreign number.
  • Dropping a leading zero that is part of the national format but must not appear after the country code.
  • Treating an extension as part of the number, which E.164 has no place for.
  • Validating length against a single rule, when it varies by country and by number type.
  • Reading a well-formatted number as a working one. Only a call or a message proves that.

Related Text Tools tools

Private & free — this tool runs entirely in your browser.