Online Playground
Browse tools

Phone Number Formatter

Format phone numbers as E.164, international, national or RFC 3966 tel: links. Paste one number or a list.

Format phone numbers

Try

Processed locally with libphonenumber-js. Nothing you enter is sent to a server.

How it works

Three steps, all in your browser

  1. 1

    Paste your numbers

    One per line, in any common style: with spaces, dashes, brackets or a leading +.

  2. 2

    Set a default country

    Numbers without a + are read in this country. Leave it blank if every number has a + prefix.

  3. 3

    Copy the format you need

    Copy a whole column as E.164, international, national or tel: links, or download everything as CSV.

In depth

The same number in 10 countries

These rows were produced by running the formatter on real example numbers. Notice how much the national format changes from country to country, while E.164 always has the same shape: a plus sign, the country calling code and the digits.

CountryE.164InternationalNational
United States+12133734253+1 213 373 4253(213) 373-4253
United Kingdom+442079460958+44 20 7946 0958020 7946 0958
Germany+4930123456+49 30 123456030 123456
France+33123456789+33 1 23 45 67 8901 23 45 67 89
India+919876543210+91 98765 43210098765 43210
Australia+61212345678+61 2 1234 5678(02) 1234 5678
Japan+81312345678+81 3 1234 567803-1234-5678
Brazil+5511912345678+55 11 91234 5678(11) 91234-5678
Spain+34612345678+34 612 34 56 78612 34 56 78
Italy+390612345678+39 06 1234 567806 1234 5678

Why international format has no brackets or hyphens

libphonenumber-js writes international numbers with spaces only, for example +44 20 7946 0958. Its documentation says this is a deliberate difference from Google's library, which sometimes uses hyphens and brackets. National format keeps each country's own style, which is why the US result above has brackets and a hyphen and the UK result starts with a 0.

Extensions are formatted per country

If a number has an extension, the library keeps it and uses the prefix people in that country expect. The US result uses " ext." and the UK result uses " x". In a tel: link the extension becomes a ;ext= parameter, which is how RFC 3966 defines it.

CountryInternational formattel: link
United States+1 650 253 0000 ext. 123tel:+16502530000;ext=123
United Kingdom+44 20 7946 0958 x123tel:+442079460958;ext=123

Common formatting mistakes

Most bad phone data comes from a handful of habits.

  • Storing the display format. Store E.164 and format on output, otherwise the same person appears as three different numbers.
  • Formatting without a country. A number without a plus sign has no meaning until you say which country it is from, so choose the default country first.
  • Keeping the (0) after the country code. People write +44 (0)20 7946 0958 in the UK. The library understands it: it returns +442079460958, with the 0 removed.
  • Putting spaces in a tel: link. RFC 3966 does not allow spaces in the number, so use the E.164 form or the formatter's tel: column.

Formats

One number, four ways to write it

FormatExampleUse it for
E.164+442079460958Databases, SMS and voice APIs, de-duplicating contacts.
International+44 20 7946 0958Showing a number to people in other countries.
National020 7946 0958Showing a number to people in the same country.
RFC 3966tel:+442079460958Click-to-call tel: links on web pages and in email.

FAQ

Questions people ask

What is the difference between E.164, international and national format?

E.164 is the machine format: a plus sign, the country code and the number with no spaces, such as +442079460958. International format adds spaces for people to read. National format drops the country code and uses the local style, such as 020 7946 0958.

Which format should I store in a database?

Store E.164. It is the one format that is unambiguous, sorts and compares cleanly, and is what SMS, voice and WhatsApp APIs expect. Format it for display when you show it.

Why is my number not formatted?

A number written without a country code cannot be placed in a country. Add the + prefix or pick a default country above.