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.

E.164 Type a number above
URL-encoded For API query strings

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

Step one: select the country

Choose the country calling code from the dropdown.

Step two: enter the number

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.

Step three: copy the output

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

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

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.

Example: Telebase lookup with a formatted number
{
  "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.

SIM swap detection

The Telebase API already returns carrier, country, number type and number validity. Telebase detects recent SIM swaps with a single API call. Get sandbox access to get started.

Get sandbox access