BlogComparisons · October 28, 2026 · 6 min read

Contact Form 7 Phone Parsing: libphonenumber-js vs google-libphonenumber vs phonenumbers vs libphonenumber-for-php vs libphonenumber-csharp

Compare five phone parsers for custom CF7 lead adapters by runtime, metadata, validation boundaries, licensing and operational maintenance.

Five green trays containing coiled ribbons surround a cream card with a telephone handset.
Generated conceptual illustration; not a product screenshot or measured result.

A Contact Form 7 telephone field collects a phone-shaped answer, but a custom lead adapter still needs rules for country context, formatting and invalid input. A maintained parsing library can make those rules more consistent. Choosing one starts with the runtime where the adapter operates, not a universal ranking.

This comparison covers five distinct developer packages: libphonenumber-js, google-libphonenumber, phonenumbers, libphonenumber-for-php and libphonenumber-csharp. It is based on official documentation reviewed on October 28, 2026, without firsthand benchmarks. None is a ready-made CF7 connector, a callback service or proof that the submitter owns a number.

Compare the integration boundary first

Decide where authoritative normalization happens. A browser may offer formatting assistance, while a server adapter validates and maps the accepted value. Keep the original answer in the authorized lead system and store a normalized copy separately when needed. Your country-context policy must be explicit for national-format numbers.

The CF7 telephone-field guide covers form setup and extensions. The choices below address the code that follows that setup. They do not establish that an existing plugin already uses any of these packages.

Library Runtime fit Useful distinction Boundary to review License and cost
libphonenumber-js JavaScript and TypeScript Selectable metadata sets Metadata selection changes validation detail MIT; no core license fee
google-libphonenumber Node.js JavaScript Packaged Google library API API objects, bundle and separate typings MIT package; Apache 2.0 bundled notices; no core fee
phonenumbers Python Python port with possible and valid checks Region context and optional metadata modules Apache 2.0; no core license fee
libphonenumber-for-php PHP Composer integration near WordPress adapters PHP requirements and dependency ownership Apache 2.0; no core license fee
libphonenumber-csharp .NET and C# Google library port for .NET services Target framework and metadata update process Apache 2.0; no core license fee

libphonenumber-js

libphonenumber-js is a JavaScript and TypeScript rewrite oriented toward personal phone numbers. It provides parsing and formatting, with different metadata sets for different requirements. That choice is useful when a browser-facing form needs a deliberate tradeoff between shipped metadata and validation detail.

Strength: it fits teams already maintaining JavaScript form assistance or a JavaScript lead service. The documented metadata options let the team choose explicitly instead of assuming every import exposes identical validation behavior. Its core is MIT licensed, without a per-request core license charge.

Limitation: a smaller metadata selection should not be treated as equivalent to every fuller validation or number-type lookup. Review the selected import path and required methods. For CF7, make browser feedback helpful while keeping the server’s acceptance policy authoritative. Measure the final application bundle yourself if size matters; this comparison supplies no measured speed or size winner.

google-libphonenumber

google-libphonenumber packages Google’s JavaScript library for convenient use in Node.js. Its documented API works with parsed PhoneNumber objects and exposes familiar Google-style utilities. It suits an adapter whose developers want that API rather than a rewritten interface.

Strength: an existing Node service can keep parsing, formatting and possible/valid checks in the same processing stage. The README explains object expectations and the separate community TypeScript definitions. That makes it possible to review the runtime package and typings as distinct dependencies.

Limitation: it is a community package and should not be described as Google’s own official npm distribution. Review its API and metadata update history alongside upstream behavior. Licensing also needs precision: the package’s license file states MIT for the package and Apache 2.0 for bundled Google Closure material. Preserve the relevant notices. There is no core subscription fee, but maintaining the adapter remains your responsibility.

phonenumbers

phonenumbers is the Python port of Google’s library. It supports parsing with region context, formatting and checks that distinguish a possible number from one considered valid by the metadata. Its documentation also describes additional metadata modules and a lighter distribution.

Strength: it fits a Python worker that already receives CF7 inquiries through a reviewed integration. Keeping processing in that worker avoids adding another runtime merely for phone parsing. The Apache 2.0 core has no license purchase requirement.

Limitation: a WordPress site does not acquire Python processing simply by collecting a telephone field. You still need transport, authentication, error handling and an operational owner. Decide whether optional geocoding, carrier or timezone metadata is necessary; metadata-derived labels do not establish the person’s present location or current ownership. Preserve parse failures as reviewable outcomes rather than replacing them with an empty contact value.

libphonenumber-for-php

libphonenumber-for-php brings parsing, validation and formatting to PHP. The project documents Composer installation and its runtime requirements. It also identifies a separate lite package for workflows needing the core PhoneNumber utility without the full package’s additional data.

Strength: it is a natural candidate for a custom PHP adapter near WordPress, where the team can review the dependency alongside existing PHP code. The Apache 2.0 license does not impose a core license fee. Its examples distinguish parsing from the subsequent validity check and formatting choice.

Limitation: this is a library, not a CF7 integration plugin. A maintained adapter must load dependencies predictably, avoid conflicts with other bundled libraries and handle exceptions. Check the current PHP and extension requirements before upgrading. Do not paste a Composer vendor tree into an unrelated plugin without assigning responsibility for updates and compatibility checks.

libphonenumber-csharp

libphonenumber-csharp is a C# port of Google’s library for .NET applications. Its project documents parsing and formatting APIs, preserves the Apache 2.0 license and describes its metadata update mechanism. The package fits an existing .NET CRM adapter or background processing service.

Strength: a .NET team can keep phone handling inside its established service, deployment and monitoring process. It does not need a separate JavaScript or Python utility solely for this field. The core package has no license fee.

Limitation: compatibility still depends on the package version and target frameworks your application uses. An automated upstream metadata process does not prove your deployed service has adopted the latest release. Pin the dependency, review updates and rerun representative fixtures. A successful parse in the service does not confirm that the resulting value was written to the intended CRM property.

Use one acceptance worksheet for the shortlist

Start with invented or officially designated example numbers. Cover national input with explicit region context, international input, formatting spaces, an extension, an impossible length and an optional blank. Add countries actually relevant to the business. Record expected acceptance and normalization separately.

Include an example the library rejects and write the operator’s next action. Some workflows should retain the raw answer for manual review rather than reject an entire inquiry. Other workflows require a valid callback format. That is a business decision to document, not a default supplied by a library.

Google’s libphonenumber FAQ explains validation boundaries. Metadata validity does not establish reachability or assignment to the submitter. Any ownership-verification step belongs to a separately authorized workflow. Do not place real calls or send messages as a routine parser test.

Choose by runtime and maintenance ownership

Shortlist libphonenumber-js for JavaScript projects needing deliberate metadata selection, or google-libphonenumber when the Google-style Node API is a better fit. Use phonenumbers in Python, libphonenumber-for-php in maintained PHP adapters and libphonenumber-csharp in existing .NET services. Confirm the shortlist with the same fixtures and the installed version’s documentation.

The open-source cores avoid a license purchase, but engineering, hosting and updates still cost time. Record who owns metadata releases and what happens when a previously rejected number becomes valid. Keep raw contact details out of broadly shared analytics.

This site publishes CF7 Analytics. Our Svetlik Analytics for Contact Form 7 plugin provides submission statistics and trends; it is not one of these parsing libraries and does not verify phone ownership. Use submission reporting alongside the adapter’s field-level evidence.

Official sources and licenses