Blog
E.164 format explained, with examples by country and how to store numbers
What the E.164 phone number format is, how to convert numbers from 12 countries, the trunk prefix traps, and how to store, index and display numbers.
Updated 2026-11-23
E.164 is the international phone number format defined by ITU-T Recommendation E.164: a plus sign, a country calling code of one to three digits, then the national number without its trunk prefix, with no spaces and 15 digits at most. +14155550123 and +447400123456 are E.164 numbers. Store every phone number in this form, keep the country beside it, and format it for people only when you display it.
What an E.164 number is made of
| Part | In +447400123456 |
Rule |
|---|---|---|
| Plus sign | + |
Marks the number as international. It replaces whatever exit code the caller's country uses. |
| Country calling code | 44 |
One to three digits, assigned by the ITU. It never starts with 0. |
| National significant number | 7400123456 |
The national number without its trunk prefix. |
| Total length | 12 digits | 15 digits at most, plus sign not counted. |
Strictly, E.164 defines the digits. The plus sign as the symbol for "an international number follows" comes from its companion recommendation, ITU-T E.123. In software, "E.164 format" means the two together, and that is the form SMS and voice APIs commonly expect.
The shape is easy to check: ^\+[1-9]\d{1,14}$. That pattern rejects spaces, missing plus signs and leading exit codes. It cannot tell you whether the number exists in its country. For that you need the numbering plan, which phone number validation covers.
E.164 examples by country
Each country writes numbers its own way at home. The E.164 form removes those differences.
| Country | Calling code | As written at home | E.164 | What changed |
|---|---|---|---|---|
| United States | +1 | (415) 555-0123 | +14155550123 |
Punctuation removed, +1 added |
| Canada | +1 | (416) 555-0123 | +14165550123 |
Same plan as the US |
| United Kingdom | +44 | 07400 123456 | +447400123456 |
Trunk 0 dropped |
| United Kingdom | +44 | 0121 234 5678 | +441212345678 |
Trunk 0 dropped |
| France | +33 | 06 12 34 56 78 | +33612345678 |
Trunk 0 dropped |
| Germany | +49 | 030 123456 | +4930123456 |
Trunk 0 dropped; German numbers vary in length |
| Germany | +49 | 01512 3456789 | +4915123456789 |
Trunk 0 dropped |
| Italy | +39 | 02 1234 5678 | +390212345678 |
The 0 stays: it is part of the number |
| Italy | +39 | 312 345 6789 | +393123456789 |
Mobile, no 0 to begin with |
| Spain | +34 | 612 34 56 78 | +34612345678 |
No trunk prefix in Spain |
| Russia | +7 | 8 (912) 345-67-89 | +79123456789 |
Trunk 8 dropped |
| Japan | +81 | 090-1234-5678 | +819012345678 |
Trunk 0 dropped |
| China | +86 | 131 2345 6789 | +8613123456789 |
Mobile, no trunk prefix to drop |
| Australia | +61 | 0412 345 678 | +61412345678 |
Trunk 0 dropped |
| Brazil | +55 | (11) 96123-4567 | +5511961234567 |
Area code kept, punctuation removed |
| Mexico | +52 | 222 123 4567 | +522221234567 |
Ten digits after +52 |
Each example is either a sample number published in libphonenumber's metadata or a number in NANPA's fictional 555-0100 to 555-0199 range. They show a format; do not expect anyone to answer.
The trunk prefix trap
The trunk prefix is the digit, or digits, dialed before a national number for calls inside the country: 0 in the UK, France, Germany, Japan and Australia, 8 in Russia, 1 before long-distance calls in North America. It is a dialing instruction, not part of the number, so it disappears after the country code.
Three cases catch people out:
- The stray zero.
+44 07400 123456keeps a trunk0after the country code. It is a frequent typo in forms and signatures. The correct form is+447400123456. Many people write+44 (0)121 234 5678on purpose, to show both forms at once; a parser should drop the(0). - Italy keeps its zero. Italian landline numbers start with
0, and that0is part of the number. Dropping it produces+39 2 1234 5678, which is not a valid number at all. - The North American 1. The
1dialed before a long-distance number in the US is also the country code. In E.164 it appears once:+14155550123, never+114155550123.
Hand-written conversion rules, such as "strip the first 0 and add the country code", break on exactly these cases. Use a parser that knows each country's plan.
Exit codes are not part of the number
To call abroad, people dial an exit code first. Most countries use 00, the prefix ITU-T recommends. The exceptions are the ones that leak into databases: 011 from the United States and Canada, 010 from Japan, 0011 from Australia.
| Stored value | Problem | E.164 |
|---|---|---|
0044 7400 123456 |
Exit code of Europe stored with the number | +447400123456 |
011 44 7400 123456 |
Exit code of North America stored with the number | +447400123456 |
447400123456 |
Plus sign missing: software may read it as a national number | +447400123456 |
7400 123456 |
Country code missing | Cannot be fixed without knowing the country |
A stored number has to work from anywhere. Only the plus sign does.
Shared calling codes: E.164 does not name the country
A calling code is not always one country. +1 covers the United States, Canada and a number of Caribbean and Pacific territories. +7 covers Russia and Kazakhstan. +44 covers the United Kingdom, Jersey, Guernsey and the Isle of Man. The leading digits after the code decide which one a number belongs to: +1 876 is Jamaica, +44 1534 is Jersey.
So E.164 identifies a line, not a country you can read off at a glance. When the country matters, for display, tax, routing or compliance, store the ISO 3166-1 code next to the number. The country calling codes tool lists every shared code and how its members are told apart.
How to store phone numbers
- One text column for the E.164 value. 16 characters fit the plus sign and 15 digits.
- Never a numeric type. Integers drop the plus sign, and spreadsheets can display long numbers in scientific notation.
- A shape constraint. Let the database refuse anything that is not E.164.
- A unique index where a number identifies an account. It only works because every number has one spelling.
- The ISO country code next to it, for display and for the shared codes above.
- Extensions in their own column. E.164 has no room for them.
- Normalize on write, format on read. Convert at the moment the number is saved, and format it at the moment it is shown.
In PostgreSQL, for example:
CREATE TABLE contacts (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
phone_e164 varchar(16) CHECK (phone_e164 ~ '^\+[1-9][0-9]{1,14}$'),
phone_country char(2),
phone_ext varchar(10),
phone_raw text
);
CREATE UNIQUE INDEX contacts_phone_e164_key ON contacts (phone_e164);
phone_raw is optional. Keeping what the person typed helps when you investigate a support ticket, but never compare or deduplicate on it.
Convert to E.164 with the API
Send what the person typed and, for numbers without a +, the country they chose:
curl https://api.qelka.com/v1/phone \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"phone": "06 12 34 56 78", "country": "FR"}'
The result carries e164: "+33612345678", national: "06 12 34 56 78", valid: true and line_type: "mobile". The basic level, at 1 credit, is all formatting needs.
In JavaScript:
export async function toE164(phone, country) {
const response = await fetch('https://api.qelka.com/v1/phone', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify(country ? { phone, country } : { phone }),
signal: AbortSignal.timeout(5000),
})
if (!response.ok) throw new Error(`Phone check failed with HTTP ${response.status}`)
const result = await response.json()
if (result.status === 'unknown') return { e164: null, problem: 'missing_country' }
if (!result.valid) return { e164: null, problem: 'invalid' }
return { e164: result.e164, country: result.country.code, problem: null }
}
The function returns the ISO country with the number, ready for the phone_country column.
| Input | country sent |
Result |
|---|---|---|
(415) 555-0123 |
US |
e164: "+14155550123" |
07400 123456 |
GB |
e164: "+447400123456" |
+49 1512 3456789 |
any, or none | e164: "+4915123456789": the + makes country unnecessary |
415 555 0123 |
none | status: "unknown", e164: null |
Choose the default country well
The country field only matters for numbers typed without a +. In order of reliability: a country picker next to the phone field, then a country you already know from a billing or shipping address, then the country of the request as your CDN reports it. Avoid one fixed default for everyone: a French number typed at home and read as a US number is invalid.
Numbers you already have
For an existing table, send up to 100 numbers per batch call, each with the best country you have for its row, and write e164 back. For a whole file, a bulk job does the same in the background and returns your file with the result columns added. Rows that come back without an e164 need a human look rather than a guess.
What to do with the result
| Result | What to store | What to tell the user |
|---|---|---|
status: "valid" |
e164, plus country.code |
Nothing, or echo the national form back |
status: "invalid" |
Nothing | Ask them to check the number, and show an example for their country |
status: "unknown" |
Nothing | Ask for the country, or for the number with its + code |
Store the E.164 value only when valid is true. A value you cannot dial is worse than an empty field, because it looks usable.
Display numbers back to people
| Where the number appears | Format | Example |
|---|---|---|
| A screen read by someone in the same country | National, as national returns it |
07400 123456 |
| A page or invoice read in several countries | International, as E.123 groups it | +44 7400 123456 |
| A clickable call link | RFC 3966 tel: URI |
tel:+447400123456 |
| A database, a CRM, an SMS provider | E.164 | +447400123456 |
To get the international format from a stored E.164 value, use a formatting library such as libphonenumber-js. A tel: link built on the E.164 value dials correctly from any phone in any country.
Edge cases
- Short codes and emergency numbers such as 911 or 112 are not E.164 subscriber numbers. Keep them out of this flow.
- Global service codes such as
+800, the universal international freephone code, are valid E.164 numbers with no country at all. - Extensions go in their own field.
+14155550123 x42is not E.164. - Numbers change hands. A valid E.164 value says the number exists, not that it still belongs to the person who gave it to you. Mobile, landline or VoIP explains porting and live carrier lookups.
To try a few numbers by hand, the free phone number formatter shows the E.164, international, national and tel: forms of any number. The E.164 formatting guide has the same conversion in Python, and the phone API reference lists every field.
Frequently asked questions
What is E.164 format?
What does a US phone number look like in E.164?
Do I keep the leading 0 when converting to E.164?
How long can an E.164 number be?
Should I store phone numbers in E.164?
Is E.164 the same as the international format?
How do I check that a string is in E.164 format?
Put this check in your product
Get an API key in under a minute. 100 free credits every month, no card required.