Phone
Format a phone number in E.164
Turn any local or international number into E.164, international, national and RFC 3966 formats.
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.
- 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.
- 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.
- 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.
- Check the length. If the length is impossible for the country, no format is built and the rows stay empty.
- 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.
- 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 https://api.qelka.com/v1/phone \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{"phone":"+12015550123","level":"basic"}'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?
How do I convert a phone number to E.164?
Should I store phone numbers with the plus sign?
What is the maximum length of an E.164 number?
Why does the formatter remove the leading 0?
Why does an Italian number keep its 0 after +39?
What is the RFC 3966 format used for?
How do I write a phone number with an extension?
What is the difference between the international format and E.164?
Why are the formats empty?
Why is the status Invalid when the formats are filled in?
How do I format phone numbers in a spreadsheet?
Is +44 (0)20 the right way to write a UK number?
Why do US numbers have parentheses around the area code?
Can short codes and emergency numbers be written in E.164?
How do I format a vanity number with letters in it?
How should a phone field accept input?
Put this check in your product
Get an API key in under a minute. 100 free credits every month, no card required.