Skip to content

Phone

Format a phone number in E.164

Turn any local or international number into E.164, international, national and RFC 3966 formats.

Try an example

How to read the result

The formatter returns one number in four standard forms. The badge tells you whether the number is valid in its country's plan, and the rows below give each format ready to copy.

Field What it means What to do with it
Status Valid: the number sits in a range its plan has opened. Invalid: it does not. An amber Invalid badge means the length is possible, so the formats are filled in, but the digits match no range. A red one means no format could be built. Copy formats from a Valid result. On amber, recheck the digits. On red, choose the country or count the digits.
E.164 Plus sign, country calling code and national number, no spaces: +12015550123. Store this one. Send it to SMS and voice providers.
International The same digits grouped with spaces, the way the country writes them: +1 201 555 0123. Print it on websites, invoices and signatures read by people in several countries.
National The number as dialed and written at home, with the trunk prefix: (201) 555-0123. Use it on screens read by people in that country.
RFC 3966 The tel: URI form: tel:+12015550123, with ;ext=42 when the input had an extension. Put it behind call links in pages and emails.
Country The country whose plan was used, with its ISO 3166-1 code. Keep it next to the number if you show national formats later.
Bulk CSV upload Locked. Normalize a whole column of numbers to E.164 in one file. Clean an export before you import it somewhere else.
API access Locked. Get e164 and national for every valid number from the phone API. Format numbers in your own code when they are saved.

The locked rows need a free account, with 100 credits every month. A basic phone check, which returns both formats, costs 1 credit.

How the check works

The formatter uses the formatting rules in Google's libphonenumber metadata, through libphonenumber-js. Each country has its own patterns, chosen by the leading digits of the number.

  1. Read the digits. Spaces, dashes, dots, slashes and parentheses are ignored. A leading tel: is removed. An extension typed as ext. 42, x42 or #42 is kept aside.
  2. Find the country. A plus sign starts a calling code. A leading 00 counts as international when no country is selected. Otherwise the country menu decides, and the number can then be typed with that country's trunk prefix or exit code.
  3. Drop the trunk prefix. The digit dialed only inside the country, such as 0 in the UK or 1 in the US, is removed from the international forms. Where the leading 0 belongs to the number, as in Italy, it stays.
  4. Check the length. If the length is impossible for the country, no format is built and the rows stay empty.
  5. Lay out the digits. The national and international formats follow the country's grouping pattern for that range. UK landlines in Birmingham read 0121 234 5678, UK mobiles 07400 123456, French numbers go in pairs.
  6. Build the machine forms. E.164 is the plus sign, the calling code and the national number with no separators. RFC 3966 puts tel: in front of it and appends the extension, if any.

Formatting only arranges digits. It does not tell you whether a line is in service. For that, see the phone validator.

The four formats side by side

Format United States United Kingdom France Use it for
E.164 +12015550123 +447400123456 +33612345678 Storage, APIs, SMS and voice providers
International +1 201 555 0123 +44 7400 123456 +33 6 12 34 56 78 Text read by people in several countries
National (201) 555-0123 07400 123456 06 12 34 56 78 Text read by people in that country
RFC 3966 tel:+12015550123 tel:+447400123456 tel:+33612345678 Call links in web pages and emails

RFC 3966 allows visual separators inside a tel: URI, so tel:+1-201-555-0123 is the same number as tel:+12015550123. A number without its country code needs a phone-context parameter in a tel: URI, which is one more reason to link to the global form.

Anatomy of an E.164 number

Part In +44 7400 123456 Rule
Plus sign + Says that a country calling code follows. It is not a digit.
Country calling code 44 One to three digits, assigned under ITU-T E.164.
National significant number 7400123456 The national number without its trunk prefix.
Length 12 digits At most 15 digits, plus sign not counted.

National formats differ from country to country

Country Landline, national format Mobile, national format What stands out
United States (201) 555-0123 (201) 555-0123 Parentheses around the area code, a hyphen before the last four digits.
United Kingdom 0121 234 5678 07400 123456 Groups follow the length of the area code.
France 01 23 45 67 89 06 12 34 56 78 Pairs of digits after the first two.
Germany 030 123456 01512 3456789 Area codes and subscriber numbers vary in length.
Japan 03-1234-5678 090-1234-5678 Hyphens between the groups.
Australia (02) 1234 5678 0412 345 678 Parentheses only around landline area codes.
Brazil (11) 2345-6789 (11) 96123-4567 Mobile numbers have one more digit, a leading 9.
China 010 1234 5678 131 2345 6789 Landlines keep the trunk 0, mobiles have none.

With styles this different, one input mask cannot fit every country. Parse the number first, then format it with the rules of its own country.

Trunk prefixes, by example

The trunk prefix is the part people most often get wrong when converting. It is dialed only inside the country, so it never appears after the country code, except in plans that have none.

Country Written at home Trunk prefix What happens to it E.164
United States (201) 555-0123 1, dialed before long-distance calls Never part of the stored number +12015550123
United Kingdom 07400 123456 0 Dropped after +44 +447400123456
France 06 12 34 56 78 0 Dropped after +33 +33612345678
Germany 030 123456 0 Dropped after +49 +4930123456
Russia 8 (912) 345-67-89 8 Dropped after +7 +79123456789
Japan 090-1234-5678 0 Dropped after +81 +819012345678
Italy 02 1234 5678 None: the 0 is part of the number Kept after +39 +390212345678
Spain 612 34 56 78 None Nothing to drop +34612345678

A stray trunk prefix typed after the country code, as in +44 (0)121 234 5678, is a frequent slip. The formatter removes it and returns +441212345678.

Common formatting mistakes

Mistake Example Correct form
Trunk prefix kept after the country code +44 07400 123456 +44 7400 123456
Exit code stored with the number 0044 7400 123456, or 011 44 7400 123456 +44 7400 123456
Country code missing 7400 123456 +44 7400 123456
Plus sign missing 447400123456 +447400123456
Spaces in a value meant to be E.164 +44 7400 123456 +447400123456
Extension in the same field +12015550123 x42 +12015550123, with 42 in an extension field
Italian 0 removed +39 2 1234 5678 +39 02 1234 5678

Exit codes depend on where the call starts: 00 from most of Europe, 011 from the United States and Canada. A stored number has to work from anywhere, and only the plus sign does. Without it, software may read 447400123456 as a national number of whatever country it assumes. Dropping Italy's 0 is worse than a style slip: +39 2 1234 5678 is not a valid number at all.

Store phone numbers so they stay usable

Formatting is a display concern. Storage needs one canonical form, and E.164 is the one that works everywhere.

  • One text column for E.164. VARCHAR(16) fits every valid number: the plus sign and up to 15 digits.
  • Never a numeric type. Integers drop the plus sign and leading zeros, and spreadsheets can show long numbers in scientific notation.
  • Extensions in their own column. E.164 has no room for them.
  • The country next to the number when you show national formats, since +1 alone does not tell the US from Canada or Jamaica.
  • Normalize on write, format on read. Convert input to E.164 when it is saved, and render national or international formats when it is shown. Two people typing (201) 555-0123 and +1 201.555.0123 then end up with one record.
  • Compare in E.164. Deduplicate contacts, match callers and join tables on the E.164 string, never on the raw input.
Where the number shows up Format to use
Database, CRM, data warehouse E.164
SMS or voice provider request E.164
Screen read by a user in the same country National
Website footer, email signature, invoice International
Clickable call button RFC 3966 tel: URI

The guide Format phone numbers in E.164 shows the conversion in code, and bulk processing normalizes an existing list in one pass.

Same check through the API

One HTTPS call, one credit. The response below is the real schema returned by the API.

cURL
curl https://api.qelka.com/v1/phone \
  -H "Authorization: Bearer sk_test_your_key" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+12015550123","level":"basic"}'
JavaScript
const response = await fetch("https://api.qelka.com/v1/phone", {
  method: "POST",
  headers: {
    Authorization: "Bearer sk_test_your_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    phone: "+12015550123",
    level: "basic",
  }),
});
const result = await response.json();
{
  "id": "lkp_01M84QZDVBQCJAMBE4TJB6VRAC",
  "object": "phone",
  "input": "+12015550123",
  "valid": true,
  "status": "valid",
  "e164": "+12015550123",
  "national": "(201) 555-0123",
  "country": {
    "code": "US",
    "name": "United States",
    "calling_code": "1"
  },
  "region": "New Jersey",
  "timezones": [
    "America/New_York"
  ],
  "line_type": "fixed_line_or_mobile",
  "carrier": {
    "name": null,
    "mcc": null,
    "mnc": null,
    "source": "numbering_plan"
  },
  "ported": null,
  "credits_used": 1,
  "cached": false
}

Bulk and pricing

  • Upload a CSV of up to 2,000,000 rows from the dashboard or the API, pick the column, get the results back as a CSV.
  • Every check costs 1 credit, live phone lookups cost 3. Cached results are billed the same way; calls that fail upstream are not billed.
  • The free plan includes 100 credits every month. Paid plans start at $29 for 10,000 credits.

Frequently asked questions

What is E.164 format?
E.164 is the ITU-T recommendation that defines international phone numbers. Written for software, it is a plus sign followed by the country calling code and the national number, with no spaces or punctuation: +12015550123 or +447400123456. Each line has exactly one E.164 form, which is why databases, SMS providers and voice platforms all ask for it.
How do I convert a phone number to E.164?
Work out the country, drop the trunk prefix, and put the plus sign and country code in front. For 07400 123456 in the UK: the country code is 44, the trunk prefix 0 goes, and the result is +447400123456. The formatter does this for any country: select the country, paste the number in any style, and copy the E.164 row.
Should I store phone numbers with the plus sign?
Yes. Store the E.164 string with its plus sign in a text column. The plus sign tells every system that a country code follows, so the number cannot be misread as a local one. Numeric columns drop it, along with any leading zero, and you lose the information you need to dial the number again.
What is the maximum length of an E.164 number?
Fifteen digits, counting the country calling code but not the plus sign. With the plus, the longest possible string is 16 characters, so a column of 16 characters holds any valid number. Most numbers are shorter: a US number is 11 digits in E.164, a French number 11, a UK mobile number 12.
Why does the formatter remove the leading 0?
Because that 0 is a trunk prefix, a digit dialed only inside the country to start a long-distance or mobile call. It is not part of the number itself. Callers from abroad replace it with the country code, so 07400 123456 becomes +44 7400 123456. The same applies to the 1 in the US and the 8 in Russia.
Why does an Italian number keep its 0 after +39?
Italy has no trunk prefix. The leading 0 of an Italian landline belongs to the number itself and is dialed from everywhere, including from abroad. So Milan's 02 1234 5678 becomes +39 02 1234 5678, with the 0 kept. Italian mobile numbers start with 3 and take no 0 in front, so a mobile reads +39 312 345 6789.
What is the RFC 3966 format used for?
RFC 3966 defines the tel: URI, the link form of a phone number. Put tel:+12015550123 behind a link in a web page or an email, and tapping it on a phone opens the dialer with the number filled in. It can carry an extension as ;ext=42. The standard allows visual separators, so tel:+1-201-555-0123 is the same number.
How do I write a phone number with an extension?
In the national format, after the number: (201) 555-0123 ext. 42. In a tel: link, as a parameter: tel:+12015550123;ext=42. E.164 has no place for extensions, so keep the extension in its own field when you store the number. The formatter reads extensions typed as ext., x or # and keeps them out of the main number.
What is the difference between the international format and E.164?
The digits are the same. The international format groups them with spaces the way the country writes them, following the notation of ITU-T E.123: +44 7400 123456. E.164 strips every space for machines: +447400123456. Show the first to people. Store and send the second.
Why are the formats empty?
The number could not be read or its length is impossible for the country. The most common cause is a national number with no country selected: 07400 123456 alone could come from several countries. Choose the country in the menu and format again. If the formats stay empty, count the digits, since one too many or too few stops formatting.
Why is the status Invalid when the formats are filled in?
The length is possible for the country, so the formatter can lay the digits out, but they match no range the plan has opened. +44 7400 12345 is an example: nine digits is a legal UK length, but UK numbers starting with 7 need ten. The amber badge flags this case. Treat the formats as a draft and check the number.
How do I format phone numbers in a spreadsheet?
Export the sheet as a CSV, upload it to bulk processing, pick the phone column and a default country, and import the result file back: it keeps your columns and adds the formatted values. In the sheet itself, format the phone column as plain text first, or the plus sign and leading zeros will be stripped when you paste.
Is +44 (0)20 the right way to write a UK number?
It is common, but it mixes two formats. The (0) is the trunk prefix shown for people dialing inside the UK, and callers from abroad must skip it. ITU-T E.123 keeps the trunk prefix out of the international format, so write +44 20 followed by the number. The formatter accepts the (0) form and removes it.
Why do US numbers have parentheses around the area code?
It is a writing convention: (201) 555-0123. The parentheses set the area code apart, a habit from the days when local calls took seven digits and the area code could be left out. Many areas now require ten-digit dialing, and 201-555-0123 is just as correct. Neither style belongs in E.164 or in a tel: link, which use +12015550123.
Can short codes and emergency numbers be written in E.164?
No. Numbers such as 911, 112 or a five-digit SMS short code work only inside one country or one network, so they have no international form. Do not run them through a formatter or store them in an E.164 column. Keep them as plain digits, together with the country where they apply.
How do I format a vanity number with letters in it?
Turn the letters into digits first, using the standard phone keypad defined in ITU-T E.161: 2 is ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV and 9 WXYZ. Then enter the digits with the country code and format the result. Store the digit form in E.164, and keep the lettered version only as a marketing label.
How should a phone field accept input?
Accept what people type: spaces, dashes, dots, parentheses and a leading plus sign. Do not force a rigid mask that rejects valid foreign formats. Ask for the country with a picker, send both values to your server, and save the E.164 result. Then show the number back in national format, so the user recognizes it.

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.