Menu

Phone numbers in E.164: the formatting bugs that break SMS and calls
📰

Phone numbers in E.164: the formatting bugs that break SMS and calls

DEV Community: backend·Packet Exchange·8 days ago
#89PO0drR
#devtobackend#devto#dev#number#phonenumbers
Long article (657 words) — no AI summary yet.
Reading 0:00
15s threshold

AI disclosure: this article was written with the help of AI and checked by a human before publishing.

Most "SMS not delivered" and "call failed" tickets I have seen were not network problems. They were phone numbers stored in a shape the carrier could not route. The fix is boring and it works: store every number in E.164 and convert at the edges.

What E.164 is

E.164 is the international numbering format. It is a plus sign, the country code, then the national number with no trunk prefix, no spaces and no punctuation. At most 15 digits after the plus.

UK mobile written locally: 07700 900123

The same number in E.164: +447700900123

A Spanish mobile: +34612345678

A US number: +12025550143

Note what happened to the UK number. The leading 0 is a trunk prefix used for dialling inside the country. It is dropped when the country code goes on. Leaving it in ( +4407700900123 ) is the single most common bug I see.

Five bugs that come from not normalising

The kept trunk zero.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.