Build a phone number input field that formats digits as the user types.
Validate and parse international phone numbers in a web or mobile app.
Determine the carrier and time zone for a given phone number.
Find and extract phone numbers from unstructured text or documents.
libphonenumber is Google's open-source library for working with phone numbers from every country in the world. It provides implementations in Java, C++, and JavaScript. The Java version is the primary one and has been part of the Android operating system since version 4.0. The library can parse a string like "044 668 18 00" (given a country context) into a structured object containing the country code and national number. Once parsed, you can validate whether the number is actually valid for the given region, format it in various standard ways (international format, national format, or the E.164 compact format used by telephone networks), check what type of line it is (mobile, landline, toll-free, VoIP, and others), and determine the geographic area associated with the number. A utility called AsYouTypeFormatter can format a number progressively as a user types each digit, which is useful for building phone number input fields. The library also includes tools for finding phone numbers embedded in free text and for mapping numbers to carriers and time zones. It is updated roughly every two weeks with metadata changes to keep up with new number ranges around the world.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.