Phone Number Parser
Parse and format phone numbers into international, national, and E.164 formats with country detection.
Frequently Asked Questions
What is E.164 format?
E.164 is an international telephone numbering plan defined by ITU-T. It specifies a maximum of 15 digits starting with a country code, with no spaces or punctuation. For example, a US number would be +15551234567.
How does the parser determine the country?
The parser matches the leading digits of the phone number against a built-in lookup table of approximately 30 common country calling codes. It tries longer codes first (e.g., +44 for UK before +4 for anything else) to find the best match.
What phone number formats are supported?
The parser handles many common formats including +1-555-123-4567, 15551234567, (555) 123-4567, 555.123.4567, and international formats with country codes. It strips all non-digit characters (except a leading +) before parsing.
How accurate is the mobile/landline detection?
The type detection is a best guess based on common patterns for each country. For the US, numbers starting with area codes followed by typical mobile prefixes are classified accordingly. For exact results, a full carrier database lookup would be needed.
Can I parse numbers without a country code?
Yes — numbers without a country code are assumed to be US/Canadian (+1) numbers. If the number has 10 digits, the parser will prepend +1 automatically. For other countries, include the country code for accurate parsing.