Tools/phone/parse

phone/parse

Parse a phone number into validity, formats, region, and line type.

Free / no pricing configured

What it does

Parses a phone number and returns whether it is valid, its E.164 / national / international / RFC3966 formats, the country calling code, region, and line type (mobile, fixed line, VoIP, and so on).

Primary use cases

  • Validating and normalizing user-entered phone numbers to E.164.
  • Determining a number's country, region, and line type.
  • Cleaning contact data before storage.

Good to know

Pass an international number (with + and country code), or set region (2-letter ISO code) for a number written in national format. Validity means the number is well-formed and within its country's numbering plan, not that the line is assigned, active, or reachable (that needs a separate carrier lookup). Computed locally from current libphonenumber metadata.

Parameters

numberstringrequired

The phone number. Include + and country code, or set 'region' for a national-format number.

regionstringoptional

Optional default region (2-letter ISO code, e.g. US, GB) for numbers without a country code.

phone/parse — Faro