HandyTools Hub

Phone Number Formatter

Parse, validate, and format international phone numbers

Use + prefix for international format (e.g., +86 138 0013 8000)

What the Formatter Produces

This tool takes a phone number in almost any notation and returns it in three shapes, plus a validity verdict and a list of problems:

  • National format — grouped the way people in that country normally write it.
  • E.164 — the machine-readable form such as +14155552671.
  • International display — the dial code followed by the grouped national number, such as +1 (415) 555-2671.

It also reports the detected country, dial code, the national number after the dial code is removed, and the digit count.

A phone number is not one string; it is a set of parts, and each audience wants a different arrangement. A local reader expects the national grouping and may include the trunk prefix. An international caller expects the country code and no trunk prefix. A machine expects E.164 with nothing but a plus, the dial code, and digits. The underlying number never changes, but dropping a separator or keeping a leading zero can turn a working string into one that an SMS gateway rejects. Converting between the three views by hand is where most mistakes creep in, which is the problem this page solves.

Auto-Detection vs Manual Country Selection

The behaviour depends entirely on whether the input starts with a plus sign.

If you type a leading +, the tool strips separators, compares the digits against every dial code, and takes the longest match. That is why +44... is read as the United Kingdom even though +4 is not itself a country code.

If there is no +, no guessing happens. You must choose a country from the dropdown, or the tool reports that it cannot determine one. This matters because the same digit string is valid in several countries — 612345678 is a normal French mobile and could look plausible elsewhere — so the page deliberately refuses to infer a country from a bare national number.

Country Rules at a Glance

The group patterns and accepted lengths are fixed per country:

CountryCodeNational patternAccepted length
United States+1(XXX) XXX-XXXX10
Canada+1(XXX) XXX-XXXX10
China+86XXX XXXX XXXX11
United Kingdom+44XXXX XXX XXX10
Japan+81XX XXXX XXXX10
South Korea+82XX XXXX XXXX9–10
India+91XXXXX XXXXX10
Germany+49XXX XXXXXXX10–11
France+33X XX XX XX XX9
Australia+61XX XXXX XXXX9
Brazil+55XX XXXXX XXXX10–11
Italy+39XXX XXX XXXX9–10
Spain+34XXX XXX XXX9
Mexico+52XX XXXX XXXX10
Russia+7XXX XXX XX XX10

Where the accepted length range is wider than the pattern, longer numbers pass validation but come back without grouping.

Worked Examples

US local number. Enter (415) 555-2671 and select United States. The result is national (415) 555-2671, E.164 +14155552671, and international +1 (415) 555-2671.

UK international number. Enter +442079460958. The plus triggers detection of +44, leaving the 10-digit national number 2079460958, grouped as 2079 460 958, with E.164 +442079460958 and international display +44 2079 460 958.

French mobile. Enter 612345678 and choose France. It is 9 digits, matching the French pattern, so it becomes 6 12 34 56 78 and E.164 +33612345678.

Limitations and False Positives

Validation here is a shape check, not a lookup. It confirms digit count and flags letters or stray symbols, but it cannot know whether a number is allocated, ported, or active. A number that passes can still be disconnected, and a real number can fail if it uses an uncommon valid format.

Two more limits are worth remembering. The trunk prefix problem affects countries that write a leading zero nationally, such as the UK, France, Germany, and Italy; you must remove it before the length check and E.164 conversion. And shared country codes collide: because the detector returns the first match of a given length, +1 always resolves to the United States and never Canada. Pick the country manually when you need the right label.

Cleaning a Phone List in Practice

When you paste a column of numbers from a spreadsheet, the most common fixes are mechanical. Strip everything that is not a digit or a leading plus, remove national trunk zeros, and then check lengths against the country rules above. Numbers that fail are usually one digit short, carrying an unexpected extension, or written with a domestic prefix such as 1- before a US area code. Decide once how you will represent each country, convert the whole column through that format, and spot-check the first and last rows. Keeping a single canonical E.164 form in storage and formatting only at display time prevents the same number appearing twice in a customer record.

  • Email Validator — Check an email address for format problems, including domain issues.
  • Test Data Generator — Produce sample names, addresses, and contact fields for testing.
  • QR Code Generator — Turn a formatted number into a scannable code.
  • Currency Converter — A companion when you are preparing international contact and billing records.

Frequently Asked Questions

Why is my Canadian number detected as United States?

Canada and the United States share country code +1, and the detector matches the longest dial code first. With equal-length codes it takes the first entry in its list, which is the United States, so every +1 number is labelled US. Choose Canada from the dropdown when that distinction matters.

Why does my UK number report 'too long' when I type it the way I write it?

You likely included the trunk prefix zero. A UK number written nationally as 020 7946 0958 has 11 digits, but the UK rule here expects the 10-digit subscriber form 2079460958. Drop the leading zero before entering numbers for E.164 conversion.

Does a valid result mean the number is real and in service?

No. Validation checks only that the characters are digits and typical separators and that the length falls within the country's range. It does not check area codes, prefixes, allocations, or whether anyone answers, so a well-formed but unassigned number can still pass.

Why is my 11-digit German number left unformatted?

The German display rule groups exactly 10 digits. The country's valid length range allows 10 or 11, so an 11-digit number passes validation but does not match the spacing template, and the tool returns the digits without separators rather than guessing.

Which countries does the formatter cover?

Fifteen: the United States, Canada, China, the United Kingdom, Japan, South Korea, India, Germany, France, Australia, Brazil, Italy, Spain, Mexico, and Russia. Each has its own national spacing template and digit-length range.

What is E.164 and why do SMS and VoIP services insist on it?

E.164 is the ITU standard for international phone numbers: a plus sign, a one-to-three digit country code, then the national number, up to fifteen digits total, with no spaces or brackets. Gateways and APIs parse that exact shape, so a human-friendly local format can be rejected or routed to the wrong place.

Reviewed by the HandyTools Hub team · Last updated