Fork me on GitHub

Phony

E164

What is E164?

It's basically a numbering scheme for international phone numbers.

A phone number is a prefix code, divided into:

  1. Country Code (1-3 digits)
  2. National Number (15 minus Country Code digits)

A national number may be split into a

  1. National Destination Code (Optional, any number of digits)
  2. Local Destination Code (Rest of the digits, up to 15 digits total)

Countries have lots of different formats and parsing schemes. This is what Phony handles for you and where it shines.

The Wikipedia entry has much more information.

Check out all the examples to see what it does.