FREEDOM251

Freedom251 › Phone Number Validation Software

libphonenumber-js

Free plan APIWeb

Visit libphonenumber-js Alternatives Pricing

libphonenumber-js's own site

What libphonenumber-js is

libphonenumber-js is a free JavaScript and TypeScript library for parsing and formatting personal phone numbers. It can check whether a number’s length is possible and whether its digits follow phone-number rules. The “As You Type” formatter handles complete or incomplete number input, and a text-search function can find full numbers, including those with extensions. Developers can choose min, max, mobile, or custom metadata to balance supported checks against bundle size. The listed full build is 145 kB, made up of 65 kB of code and 80 kB of metadata. The README compares that size with 550 kB for Google’s library. Developers can install it through npm or add it to a web page using a script tag or an npm CDN such as unpkg or jsDelivr. It is open source under MIT and Apache-2.0 licenses. The library does not handle emergency numbers, short codes, alphabetic numbers, or geolocation. Its live formatter accepts digits and an initial plus sign, ignores other punctuation, and does not support entering extensions. Strict digit validation may become stale as numbering plans change, so the README suggests considering length-only validation for some applications. For React phone-number components, it points to a separate project.

Who it suits

It suits JavaScript and TypeScript developers who need phone-number parsing, formatting, or validation in an API or web project. Developers building a React phone-number component are directed to a separate project.

What it does well

  • Checks possible length and digit validity.
  • Formats partial and complete input as users type.
  • Can find phone numbers in text, including numbers with extensions.
  • Metadata options let developers balance checks and bundle size.
  • Available through npm or web-page script tags.

What to know first

  • Does not handle emergency numbers or short codes.
  • Does not support alphabetic numbers or geolocation.
  • As-you-type input does not support entering extensions.
  • Strict digit validation can become stale as numbering plans change.

Limits

The free package does not provide bulk validation or carrier data. Its documented scope excludes emergency numbers, short codes, alphabetic numbers, and geolocation; strict digit validation may become outdated as numbering plans change.

Plans

PlanBilled and limitsPrice
libphonenumber-jsOpen-source JavaScript/TypeScript library · MIT and Apache-2.0 licensesFree

As github.com lists them, read 8 Oct 2026. The maker's own page has the final word.

Getting started

  1. Install the package with npm, or add it to a web page with a script tag or npm CDN.
  2. Choose min, max, mobile, or custom metadata for the checks and bundle size you need.
  3. Use the library to parse, format, validate, or search phone numbers.
  4. For a React phone-number component, refer to the separate react-phone-number-input project.

libphonenumber-js is a free JavaScript and TypeScript library for developers adding personal phone-number handling to applications. It suits teams that want local parsing, formatting, and validation with control over shipped metadata. The strongest case is a smaller dependency than Google’s library; the weakest is its limited treatment of special numbers and extensions.

Overview

This is an open-source library released under MIT and Apache-2.0 licenses, intended for parsing and formatting personal phone numbers rather than providing a hosted lookup service. It runs through an API or in web applications, and can be installed with npm or loaded into a page with a script tag or npm CDN services such as unpkg and jsDelivr.

Key features

libphonenumber-js distinguishes a number that is possible by length from one whose digits satisfy current phone-number rules. That gives form developers a useful choice: length checks are less strict but less vulnerable to numbering-plan changes, while digit validation is more exact but can become stale as plans evolve.

The “As You Type” formatter parses both incomplete and complete input, making it suitable for a conventional phone field. Its input contract is narrow: it accepts digits and an initial plus sign, ignores other punctuation, and cannot accept extensions while the user types. Applications that need extension entry in the same interaction will need a different input design.

Text search can locate complete phone numbers, including numbers with extensions, which is useful for processing user-supplied text rather than only structured form fields. The library also offers line-type and reachability data, but no carrier data and no bulk-validation capability.

Metadata can be selected as min, max, mobile, or a custom set. This lets a team trade supported checks against bundle size instead of accepting one fixed payload. The full build is 145 kB, split into 65 kB of code and 80 kB of metadata, versus 550 kB for Google’s library. That is a meaningful reduction for browser bundles, provided the chosen metadata covers the application’s required countries and checks.

The scope is deliberately narrower than a complete telephone-information platform. Emergency numbers, short codes, alphabetic numbers, geolocation, and other special cases are outside its handling. React developers are directed to the separate react-phone-number-input project for a React phone-number component. Issues and behavior differences from Google’s library can be reported through GitHub or GitLab; GitLab is identified as the primary repository and GitHub as a backup.

Pricing

libphonenumber-js costs free under its sole free plan. It is an open-source JavaScript/TypeScript library with no paid tier, free trial, seat charge, quota, or renewal term stated. That makes it appropriate when validation runs inside your own application and you do not need a metered hosted API. It does not provide a paid upgrade for bulk validation, carrier data, or other service-level additions.

Platforms

The package is listed for API and web use. npm installation, browser script tags, and CDN delivery cover the web distribution paths described for the library.

Who it's for

Choose it for a development team building phone fields, parsers, or text-processing workflows that can keep metadata in the application and want a smaller JavaScript footprint. It is particularly suitable when free, local processing and configurable validation matter more than carrier intelligence or managed request capacity.

Look elsewhere if the product must validate large datasets in bulk, identify carriers, handle emergency or short numbers, provide geolocation, or accept extensions during live typing. Teams needing a ready-made React component should also evaluate the separate project recommended by the README.

Pros and cons

Pros

  • Free open-source distribution: the library costs nothing and uses MIT and Apache-2.0 licenses.
  • Configurable payload: min, max, mobile, and custom metadata let developers manage bundle size and checking coverage.
  • Broad everyday handling: parsing, formatting, possibility checks, rule-based validation, live formatting, and text search cover common application workflows.
  • Smaller full build: 145 kB is substantially below the 550 kB comparison for Google’s library.

Cons

  • Narrow special-number scope: emergency numbers, short codes, alphabetic numbers, geolocation, and other special cases are not handled.
  • Validation can age: strict digit checks depend on numbering rules that change, so length-only validation may be safer for some uses.
  • Typing limitations: punctuation is ignored and extensions cannot be entered in the “As You Type” formatter.
  • No carrier or bulk service: carrier data and bulk validation are absent, so data-enrichment or batch workloads need another tool.

Alternatives

For a broader directory of options, see Phone Number Validation Software.

Accessibility Test Framework for Android is a free Android-focused framework rather than a phone-number library, so choose it for accessibility testing.

Abstract Email Validation API is a freemium API for email validation, with paid request plans, and is the better fit for email-focused checks.

IPQualityScore Phone Validation API is a freemium API with a free trial and hosted lookup pricing, suited to teams wanting an external phone-validation service.

numlookupapi.com offers freemium hosted plans with request quotas and batch validation, making it a choice for API-driven workloads.

PhoneValidationAPI is a freemium API with monthly request plans for teams that prefer managed validation.

Veriphone is a freemium API with a free trial, carrier and line-type data, bulk CSV support, and monthly validation credits.

Neutrino Phone Validate is a freemium API with a limited free account and paid request tiers.

Numverify is a freemium API from APILayer with a free trial and paid request plans.

Verdict

libphonenumber-js is the right choice for developers who need free, in-application handling of ordinary personal numbers and want to keep browser payloads under control. Choose it for its local toolkit and metadata flexibility; look elsewhere when special numbers, extensions during typing, carrier data, or bulk and hosted validation are core requirements.

Verdict

libphonenumber-js provides parsing, formatting, and validation tools with selectable metadata for different needs. Its stated exclusions and input constraints matter for applications handling special numbers or extensions.

Questions

How much does libphonenumber-js cost?

It is free under MIT and Apache-2.0 licenses. Its listed plan is free.

How can developers install it?

It can be installed with npm or included in a web page through a script tag or an npm CDN service such as unpkg or jsDelivr.

What can it validate?

It can check whether a number has a possible length and whether its digits match phone-number rules. The README cautions that strict digit validation can become stale as numbering plans change.

Does it support live formatting?

Yes. Its “As You Type” formatter works with complete or incomplete phone-number input. It accepts digits and an initial plus sign, ignores other punctuation, and does not support entering extensions.

Does it handle carrier data or bulk validation?

No. The listed facts say carrier data and bulk validation are unavailable.

Where is the primary repository?

The README identifies GitLab as the primary repository and GitHub as a backup. It says issues can be reported on GitHub or GitLab.

Facts from libphonenumber-js's own pages

Bundle size
The README compares its 145 kB full build (65 kB code plus 80 kB metadata) with 550 kB for Google’s library. · github.com, 8 Oct 2026
Input caveat
The “As You Type” formatter accepts digits and an initial plus sign, ignores other punctuation, and does not support entering extensions. · github.com, 8 Oct 2026
Live formatting
Its “As You Type” formatter parses and formats complete or incomplete phone-number input. · github.com, 8 Oct 2026
Metadata options
Developers can choose min, max, mobile, or custom metadata to balance supported checks and bundle size. · github.com, 8 Oct 2026
Notable limits
It does not handle emergency numbers, short codes, alphabetic numbers, or geolocation, among other special cases described in the README. · github.com, 8 Oct 2026
Purpose
A smaller JavaScript/TypeScript rewrite of Google Android’s libphonenumber for parsing and formatting personal phone numbers. · github.com, 8 Oct 2026
React integration
The README directs developers building a React phone-number component to the separate react-phone-number-input project. · github.com, 8 Oct 2026
Repository status
The README identifies GitLab as the primary repository and says GitHub is used as a backup. · github.com, 8 Oct 2026
Support
The README says issues can be reported on GitHub or GitLab and gives instructions for reporting behavior differences from Google’s library. · github.com, 8 Oct 2026
Text search
The library can find complete phone numbers in text, including numbers with extensions. · github.com, 8 Oct 2026
Validation
It can check whether a number is possible by length and whether it is valid by checking its digits against phone-number rules. · github.com, 8 Oct 2026
Validation caveat
The README cautions that strict digit validation can become stale as numbering plans change and recommends considering length-only validation for some applications. · github.com, 8 Oct 2026
Web distribution
The package can be installed with npm or included in a web page through a script tag or npm CDN service such as unpkg or jsDelivr. · github.com, 8 Oct 2026

Where libphonenumber-js stands on Freedom251

Look at these too