Skip to content

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 123456 keeps a trunk 0 after the country code. It is a frequent typo in forms and signatures. The correct form is +447400123456. Many people write +44 (0)121 234 5678 on purpose, to show both forms at once; a parser should drop the (0).
  • Italy keeps its zero. Italian landline numbers start with 0, and that 0 is part of the number. Dropping it produces +39 2 1234 5678, which is not a valid number at all.
  • The North American 1. The 1 dialed 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 x42 is 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?
E.164 format writes a phone number as a plus sign, the country calling code and the national number, with no spaces or punctuation and 15 digits at most. A London mobile written 07400 123456 at home becomes +447400123456. The name comes from ITU-T Recommendation E.164, the international public telecommunication numbering plan. SMS and voice APIs commonly expect numbers in this form, which is why it is the one to store.
What does a US phone number look like in E.164?
A plus sign, the country code 1, then the ten digits of the number: area code, exchange and line number. (415) 555-0123 becomes +14155550123. The leading 1 that Americans dial before long-distance calls is the country code here, so it appears once, never twice. Canada and the other members of the North American Numbering Plan use the same +1 and the same ten-digit structure.
Do I keep the leading 0 when converting to E.164?
Usually not. In the UK, France, Germany, Japan, Australia and many other countries, the leading 0 is a trunk prefix dialed only inside the country, so it is dropped after the country code: 07400 123456 becomes +447400123456. Italy is the classic exception. Its landline numbers keep their 0, so 02 1234 5678 in Milan becomes +390212345678. A parser that knows each country's plan handles both cases.
How long can an E.164 number be?
At most 15 digits, counting the country calling code and not counting the plus sign. Country codes have one to three digits, so the national part can be up to 14 digits for a one-digit code like +1 and up to 12 for a three-digit code like +353. In practice most numbers are shorter. A text column of 16 characters holds any E.164 number with its plus sign.
Should I store phone numbers in E.164?
Yes, as the canonical value. One number then has exactly one spelling, so unique constraints, deduplication and lookups work, and the country travels with the number. Keep the ISO country code beside it when you display national formats, because +1 alone does not tell the United States from Canada. Store extensions in a separate column and format numbers for humans only when you show them.
Is E.164 the same as the international format?
Not quite. E.164 is the machine form, with no spaces: +442079460123. The international format people read groups the same digits with spaces, as ITU-T E.123 describes: +44 20 7946 0123. Both start with a plus sign and drop the trunk prefix. Store the first and print the second on pages read by people in several countries. For call links, use tel:+442079460123 as RFC 3966 defines.
How do I check that a string is in E.164 format?
A shape check is simple: a plus sign, a first digit from 1 to 9, then 1 to 14 more digits, with nothing else. That catches spaces, missing plus signs and exit codes. It does not tell you the number is valid in its country: +11234567890 has the right shape but no North American area code starts with 1. Run a numbering plan check, such as the phone validator, for that.

Put this check in your product

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