Xerobit

Format Phone Number into Standard Styles

Paste raw digits and pick a country code to format phone number strings into E.164, national, international and RFC3966 representations. The tool applies standard spacing, punctuation and prefix rules for each region entirely in the browser, so no data is uploaded anywhere.

Result

  • E.164
    +12025550147
  • National
    (202) 555-0147
  • International
    +1 202 555 0147
  • RFC3966
    tel:+1-202-555-0147

How to use the phone number formatter

  1. Paste or type the raw phone number into the Phone number field. Digits, spaces, dashes and plus signs are all accepted.
  2. Select the two-letter Country code that matches the number's origin. This tells the formatter which dialing rules to apply.
  3. The formatted results appear immediately below as you type. No button press is needed.
  4. Copy the style you need: E.164 for APIs, National for display, or RFC3966 for click-to-call links.

What each format means

When you format phone number strings, four standard representations cover nearly every use case:

  • E.164: The global standard defined by the ITU-T. It starts with a plus sign, followed by the country calling code and the subscriber number, with no spaces or punctuation. Example: +12025550147. Most APIs, databases and SMS gateways require this form.
  • National: The way people in the number's home country write it, including the trunk prefix (like 0 in the UK or Germany) and local spacing or punctuation. Example: (202) 555-0147 for the US or 020 7123 4567 for the UK.
  • International: Similar to E.164 but uses spaces instead of running all digits together, making it easier for humans to read. Example: +1 202 555 0147.
  • RFC3966: A URI scheme for telephone numbers used in HTML click-to-call links. It prefixes the E.164 string with tel: and separates groups with hyphens. Example: tel:+1-202-555-0147.

How the formatting logic works

The tool first strips every character that is not a digit or a leading plus sign. If the input starts with +, the parser reads the next one to three digits as the country calling code and matches it against known codes (for example, 1 for North America, 44 for the UK, 61 for Australia). If there is no plus sign, the selected country dropdown supplies the calling code.

Next, the formatter checks whether the national significant number begins with a trunk prefix. In countries like the UK, Germany and Australia, domestic numbers start with a 0 that must be dropped when converting to E.164. For instance, the UK number 020 7123 4567 becomes +44 20 7123 4567 internationally: the leading 0 is removed and replaced by +44.

Finally, spacing rules specific to each country are applied to produce the national and international display forms. The US uses a 3-3-4 grouping (XXX) XXX-XXXX, while Australia uses a 4-3-3 pattern for mobiles 04XX XXX XXX.

Common formats by country

This table shows how the same logical number looks across different regions when you format phone number values using standard rules.

CountryNationalE.164International
United States(202) 555-0147+12025550147+1 202 555 0147
United Kingdom020 7123 4567+442071234567+44 20 7123 4567
Germany0151 12345678+4915112345678+49 151 12345678
Australia0412 345 678+61412345678+61 412 345 678
France01 23 45 67 89+33123456789+33 1 23 45 67 89

Where to use each style

Choosing the right representation prevents bugs and improves user experience. Use E.164 whenever you store numbers in a database, pass them to an SMS gateway, or send them through a REST API. Its lack of spaces and punctuation makes it unambiguous for machines.

Use the National format when displaying a number back to users who are in the same country. People recognize their local conventions instantly, whereas E.164 can look unfamiliar on a business card or checkout page.

Use RFC3966 inside HTML anchor tags for click-to-call functionality. Mobile browsers intercept this URI scheme and open the native dialer directly. You can generate the correct string with this tool and paste it straight into your markup.

Mistakes to avoid

A frequent error is storing numbers with local formatting characters like parentheses, spaces or dashes. When you later try to dial or message those strings programmatically, the extra characters cause failures. Always normalize to E.164 before saving.

Another issue is mishandling the trunk prefix. If you take a UK number written as 07911 123456 and simply prepend +44, you get +4407911123456, which is invalid. The leading zero must be stripped first, yielding +447911123456.

Finally, do not assume every country has the same number length. While US numbers are always 10 digits nationally, German numbers vary between 10 and 12 digits, and some countries have even shorter lengths. Rely on established metadata rather than hard-coded regular expressions.

Worked examples

Each result below was produced by the same code the tool runs, so you can check your own numbers against them.

ExampleInputResult
US mobilePhone number: 2025550147; Country code (ISO 3166-1 alpha-2): USE.164: +12025550147; National: (202) 555-0147; International: +1 202 555 0147; RFC3966: tel:+1-202-555-0147
UK landlinePhone number: 02071234567; Country code (ISO 3166-1 alpha-2): GBE.164: +442071234567; National: 020 7123 4567; International: +44 20 7123 4567; RFC3966: tel:+44-20-7123-4567
German mobilePhone number: 015112345678; Country code (ISO 3166-1 alpha-2): DEE.164: +4915112345678; National: 0151 12345678; International: +49 151 12345678; RFC3966: tel:+49-151-123-456-78
Australian numberPhone number: 0412345678; Country code (ISO 3166-1 alpha-2): AUE.164: +61412345678; National: 0412 345 678; International: +61 412 345 678; RFC3966: tel:+61-412-345-678

FAQ

What is E.164 format?

E.164 is an international standard for phone numbers. It includes a plus sign, the country calling code and the subscriber number with no spaces or punctuation, limited to 15 digits total.

Why do I need to select a country code?

If you enter a number without a leading plus sign, the tool needs the country code to know which dialing rules, trunk prefixes and spacing conventions to apply.

Can I paste a number that already has dashes or spaces?

Yes. The formatter strips all non-digit characters except a leading plus sign before applying the correct layout.

Is my phone number sent to a server?

No. All parsing and formatting happens locally in your browser. Nothing is uploaded or stored.

What is RFC3966 used for?

RFC3966 defines the tel: URI scheme. It is used in HTML links so that tapping a phone number on a mobile device opens the dialer automatically.

Does this handle extensions?

This tool focuses on the core phone number. Extensions should typically be stored separately or appended after a semicolon in a tel: URI.