Blog·Craft·

A phone number comes back in three formats

/phone returns e164, national, and international formatting in the same response, no client-side formatting needed.

Nobody wants to write a phone-formatting library.

GET /phone/+442071838750
{ "valid": true, "e164": "+442071838750", "country": "GB", "national": "020 7183 8750", "international": "+44 20 7183 8750" }

One call, three ways to display the same number. e164 is the form to store, national is what a UK reader expects on a form, international is what a dialer outside the country needs.

No formatting logic on your end

A signup form, an invoice, and a click-to-call link each want the number written differently. Pulling all three off one response means there's nothing to reformat, no locale library, no manual spacing rules per country. e164 doubles as the safe key for storage and deduplication, since two different-looking inputs for the same number always normalize to the same string.

Try it

Call /phone with a number from a country other than your own and compare the three fields. Pick whichever one your framework already expects.