Developer tools
E.164 Phone Number Formatter and URL Encoder
Paste any phone number below to get the E.164 formatted version and the URL-encoded string you need for API query parameters. Runs entirely in your browser. No data leaves the page, no sign-up required.
A sandbox (tb_test_) key accepts only the three test numbers +447700900001, +447700900002 and +447700900003. A real number needs a live key.
What is E.164?
E.164 is the ITU-T international numbering plan. It defines the format that every public telephone number worldwide must follow: a + prefix, a country calling code (one to three digits), and a subscriber number, with a maximum length of 15 digits and no spaces, dashes or brackets.
Most telecom APIs expect E.164 as the input format. The Telebase carrier lookup API accepts a full international number in a few common forms and normalises it to E.164, but it rejects national formats such as 07700 900002, so formatting to E.164 first is the safest approach.
Why URL encoding matters for API calls
The + character at the start of an E.164 number is a reserved character in URLs. In a query string, a raw + is interpreted as a space. To pass a phone number as a query parameter, you need to encode the + as %2B.
For example, +447700900002 becomes %2B447700900002 in a URL. The formatter above gives you both versions so you can copy the right one for your context.
How the formatter works
Choose the country calling code from the dropdown.
Paste or type the subscriber number. The tool strips spaces, dashes, brackets and leading zeroes automatically. If the number already has a + and country code, the tool detects that and skips the prefix.
The E.164 string and the URL-encoded version appear instantly. Use the copy buttons, or grab the example curl command to test against any phone lookup API.
Common formatting mistakes
- Leading zero not removed. UK numbers are often written as 07700 900002. The leading zero is a trunk prefix, not part of the international number. E.164 for this number is
+447700900002, not+4407700900002. - Raw
+in a query string. Passing?phone=+447700900002sends a space instead of a plus. Use?phone=%2B447700900002. - Spaces and punctuation left in. E.164 contains only digits and the leading
+. Strip spaces, dashes, dots and brackets before you store or cache a number, so the same number always produces the same key. - Country code applied twice. If someone pastes
+447700900002while GB is selected, a naive formatter would produce+44447700900002. This tool checks for an existing prefix first.
E.164 formatting rules by market
Each of these four markets has its own trunk prefix convention. The table below shows the local format, what to strip, and the resulting E.164 number.
Quick reference
- United Kingdom (+44): local numbers start with 0 (e.g. 07700 900002). Strip the leading 0. E.164:
+447700900002. - Germany (+49): local numbers start with 0 (e.g. 0151 12345678). Strip the leading 0. E.164:
+4915112345678. - Netherlands (+31): local numbers start with 0 (e.g. 06 12345678). Strip the leading 0. E.164:
+31612345678. - France (+33): local numbers start with 0 (e.g. 06 12 34 56 78). Strip the leading 0. E.164:
+33612345678.
Using the formatted number with an API
Once you have the URL-encoded number, you can pass it directly to any phone lookup endpoint. The Telebase quickstart walks through a complete first lookup.
{
"phoneNumber": "+447700900002",
"active": true,
"carrier": "Telebase Test Carrier",
"country": "GB",
"numberType": "mobile",
"simSwap": "NO_SWAP",
"simSwapAt": "2026-09-22T09:16:03.003Z",
"simSwapPeriod": "PT240H",
"_meta": { "environment": "test", "activeSource": "SYNTHETIC" },
"chargedCents": 0,
"currency": "EUR"
}
SIM swap detection is returned in the same call: see the SIM swap API.
Get sandbox access