Phone Number Parser

Share:

Parse and format phone numbers in E.164, national, and international formats. Country dropdown defaults to ASEAN.

RT-DEV-072 · Developer Tools
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

Phone Number Parser Tool

Advertisement
After results · AD-W1 Responsive · Post-tool — peak engagement

How to use the phone parser

Single mode

Paste a phone number with or without a country prefix. Pick the default country (the country to assume when no + is provided). The tool returns E.164, national format, international format, RFC 3966 (tel:), and line type.

Numbers starting with +

If the input starts with +, the country is read from the number itself and the dropdown becomes optional. Otherwise the dropdown's country is used to interpret a national-format number.

Bulk mode for lists

Paste hundreds of phone numbers; the tool builds a table with one row per number showing valid/invalid, E.164, national format, country, and line type. Download as CSV for Excel or your CRM.

ASEAN-first defaults

Singapore, Malaysia, Indonesia, Thailand, Philippines, Vietnam, Brunei, Cambodia, Laos, and Myanmar are listed first in the country dropdown. The rest of the world is in alphabetical order below.

Advertisement
After how-to · AD-W2 Responsive

Phone number parsing — E.164 and the ASEAN landscape

Phone numbers look simple. They're not. The same 8-digit string can be valid in Singapore (where mobile numbers are 8 digits starting with 8 or 9), simultaneously invalid in Malaysia (10-11 digits), and ambiguous in Indonesia (numbers start with 0, dropped when written internationally). Add international prefixes (+65, +60, +62), local trunk prefixes (the 0 you dial domestically but drop internationally), carrier-specific number ranges, and the difference between mobile, fixed-line, VoIP, and premium-rate numbers — and you have a parsing problem complex enough that Google maintains a dedicated open-source library to handle it. libphonenumber ships in C++, Java, JavaScript, Swift, Ruby, and Python; this tool uses the JavaScript port, self-hosted from this domain.

E.164 — the international standard

E.164 is the ITU-T recommendation that defines the modern international phone number format. An E.164 number is + followed by the country code, followed by the national subscriber number, with a maximum of 15 digits total. +6591234567 is a Singapore mobile number in E.164. The format has no spaces, dashes, or parentheses. Every SMS gateway, WhatsApp Business API, Twilio integration, Stripe Connect verification, and modern CRM expects numbers in E.164. Storing phone numbers in any other format leads to deduplication failures, SMS delivery problems, and inability to route calls. The rule: store E.164, display national.

ASEAN country codes and carrier prefixes

Quick reference table for the region:

  • Singapore (+65): 8-digit subscriber number. Mobile starts with 8 or 9; fixed-line starts with 6.
  • Malaysia (+60): 7-9 digit subscriber number. Mobile starts with 1 (e.g. 011, 012, 013, 014, 016, 017, 018, 019); fixed-line starts with 2-9 by region.
  • Indonesia (+62): 8-12 digit subscriber number. Mobile starts with 8; fixed-line by region (Jakarta is 21).
  • Thailand (+66): 8-9 digit subscriber number. Mobile starts with 6, 8, or 9; fixed-line by region.
  • Philippines (+63): 10-digit subscriber number. Mobile starts with 9; fixed-line varies by carrier and region.
  • Vietnam (+84): 9-10 digit subscriber number. Mobile starts with 3, 5, 7, 8, or 9 (re-allocated on 15 September 2018 — Viettel's 0163 became 033 and VinaPhone's 0123 became 083).

The trunk prefix gotcha

Most countries (including all of ASEAN) have a trunk prefix that you dial domestically but drop when calling internationally. In Singapore, you dial 91234567 (without 0). In Malaysia, you dial 012-345 6789 — the leading 0 is dropped when written internationally as +60 12-345 6789. In Indonesia, the local form 0812 3456 7890 becomes +62 812-3456-7890 internationally. Confusion between these two forms is the single most common phone-number bug in ASEAN integration projects. The tool above normalises everything to E.164 so you don't have to remember which countries strip 0 and which don't.

Why libphonenumber is the standard

Google's libphonenumber is an open-source library for parsing, formatting and validating international phone numbers. It encodes country-specific rules — which prefixes mean mobile or fixed-line, valid lengths, formatting patterns — as metadata that has to be refreshed as countries renumber. This tool uses libphonenumber-js, an independent, smaller JavaScript rewrite built on Google's metadata — its full-metadata build (236 KB), the one that can tell mobile from fixed-line, served from this site's own domain, no third-party CDN.

Numbers that look valid but aren't

Three traps: the number is well-formed but assigned to a non-existent prefix (libphonenumber knows current allocations and will flag these); the country code is correct but the trunk-prefix zero is still attached (e.g. +44 0207… should be +44 207…); or the number is a "test" range deliberately reserved for documentation (UK 020 7946 0xxx, US 555-0100 to 555-0199). The parser surfaces these as invalid even when the digit count looks plausible.

Fifteen digits is the ceiling, and Singapore reached eight in two steps

01

E.164 caps every international phone number at 15 digits — country code plus national number. The longest country codes are 3 digits (e.g. +965 Kuwait), leaving 12 digits for the subscriber number.

02

Singapore reached 8 digits in two steps: mobile and pager numbers gained a leading 9 in 1995, fixed lines a leading 6 in March 2002 (IMDA).

03

On 15 September 2018 Vietnam turned 11-digit mobile numbers into 10-digit ones — Viettel's 0162–0169 became 032–039, VinaPhone's 0123/0124 became 083/084 — with old and new both dialling until 14 November 2018.

04

The prefix for dialling out of a country varies — 011 from North America, for one — which is why E.164 writes + instead and lets a mobile phone supply the right one.

05

A mobile prefix names only the operator a range was first allocated to: number portability lets a customer keep the number when changing operator, so the prefix no longer tells you the current one.

06

An Indonesian number written locally as 0812 3456 7890 drops its trunk 0 to become +62 812-3456-7890 — mobiles there start with 8.

07

A country code is one to three digits — +1, +65, +965 — so the national part of a 15-digit number can be 12 to 14 digits.

08

The test ranges exist for a reason: UK drama numbers such as 020 7946 0xxx and US 555-0100 to 555-0199 are reserved so fiction and documentation never ring a real person.

09

+800 is not a country: it carries Universal International Freephone Numbers, one number reachable free of charge from each country that supports the service.

10

A parser is only as current as its metadata: countries renumber and open new ranges, so the library has to be refreshed. The copy here is libphonenumber-js 1.10.62, released May 2024.

Frequently asked questions

E.164 is the ITU-T standard for international phone number format — + followed by country code and subscriber digits, max 15 total. Every SMS gateway, WhatsApp API, Stripe verification, and CRM expects E.164. Storing any other format causes deduplication failures and routing problems.
When converting national format to E.164, yes — most countries (all of ASEAN) drop the leading trunk prefix internationally. Singapore 91234567 becomes +6591234567. Malaysia 0123456789 becomes +60123456789. libphonenumber handles this automatically.
Possible: the number has the right length and digit pattern for its country. Valid: it matches a known assignment range from the country's carrier. Some valid-but-unallocated numbers may be "possible but not valid." For most use cases, valid is the right check.
libphonenumber's getNumberType() returns MOBILE, FIXED_LINE, FIXED_LINE_OR_MOBILE, VOIP, TOLL_FREE, PREMIUM_RATE, or UNKNOWN. Detection is rule-based on the prefix range. For mobile-only routes (SMS, OTP), filter for MOBILE or FIXED_LINE_OR_MOBILE.
Not reliably. Mobile number portability lets a number move between carriers without changing the digits. Prefix-based carrier detection now gives only the ORIGINAL allocation, not necessarily the current one.
No. All parsing runs in your browser via self-hosted libphonenumber-js. Your phone numbers never leave the page; nothing is sent to any server. You can verify via your browser's network tab.
E.164 with no spaces, dashes, or parentheses. +6591234567 works; +65 9123 4567 may be rejected depending on the API gateway. The tool above outputs strict E.164 ready to paste.
libphonenumber knows about the change. An old-format number like +84163xxxxxxx (Viettel) is now invalid; its new form is +8433xxxxxxx, and VinaPhone's +84123… became +8483…. If your customer database contains pre-September-2018 Vietnamese numbers, rewrite the prefix or refresh the contact data.
Without the leading +, the same digits can be valid in multiple countries. 91234567 could be a Singapore mobile, a Hong Kong number, or a partial UK number depending on context. Always include country code in stored data; the dropdown default in the tool is what disambiguates user input.
Self-hosted libphonenumber-js v1.10.62 (released May 2024) — an independent JavaScript rewrite built on the metadata of Google's libphonenumber. Its full-metadata build (236 KB), served from this site's own domain. A number range opened after that release may not validate yet.

Method & sources

How it computes

Parses with self-hosted libphonenumber-js 1.10.62, full-metadata build, against the chosen default country, and returns validity, E.164, national and international formats, the RFC 3966 tel: URI and line type (mobile, fixed line, VoIP…). A bulk mode does the same per line. Runs in the browser.

What this tool implements

  • ITU-T E.164 caps an international number at 15 digits; the tool stores that form.
  • The vendored bundle was libphonenumber-js's default min build, whose getType() always returns undefined and whose isValid() passed Vietnam's retired +84163… numbers; it is now the max build, which types numbers and rejects them.
  • IMDA: mobiles gained a leading 9 in 1995 and fixed lines a 6 in March 2002 (the page said April 2002 for both). Vietnam's ministry: from 15 Sep 2018 Viettel's 0163 became 033 and VinaPhone's 0123 became 083 (the page said 0163 became 083).

Sources

What can make this go out of date

  • libphonenumber-js 1.10.62 (released 4 May 2024), self-hosted, whose bundled metadata decides validity and line type; a number range opened after that release may not validate until the library is updated.
Advertisement
Pre-footer · AD-W3 728 × 90