NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #1953 most downloaded on npm
A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
Latest stable
1.13.17
Last release 9 days ago
19 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Most releases are documented
notes for 38 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
460 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
findNumbers(), searchNumbers(), PhoneNumberMatcher don't throw "Unknown country" error anymore: a non-existent country is simply ignored instead. Same
findNumbers(), searchNumbers(), PhoneNumberMatcher don't throw "Unknown country" error anymore: a non-existent country is simply ignored instead. Same goes for getExampleNumber() and getExtPrefix().
parsePhoneNumberFromString() doesn't return undefined if a non-existent default country is passed: it simply ignores such country instead and still parses international numbers.
Added isSupportedCountry(country) function.
Added CDN bundles for min/max/mobile sub-packages.
Moved demo to max metadata (was min previously).
Added TypeScript definitions for min/max/mobile/core sub-packages.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added /min, /max, /mobile and /custom subpackages pre-wired with different flavors of metadata. See the relevant readme section for more info.
Added /min, /max, /mobile and /custom subpackages pre-wired with different flavors of metadata. See the relevant readme section for more info.
parsePhoneNumberFromString() function (which doesn't throw but instead returns undefined).Refactored the code to remove cyclic dependencies which caused warnings on React Native. It's not a breaking change but it's still a big code diff ove…
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Support Russian extension character "доб" as a valid one while parsing the numbers.
Added .getNumber() method to AsYouType formatter instance. Returns a PhoneNumber.
.getNumber() method to AsYouType formatter instance. Returns a PhoneNumber.(metadata file internal format breaking change) (doesn't affect users of this library) If anyone was using metadata files from this library bypassing…
Added parsePhoneNumber() function and PhoneNumber class.
Added v2: true option to findNumbers() function.
Added getExampleNumber() function.
Added isPossibleNumber() function.
In formatNumber() renamed National to NATIONAL and International to INTERNATIONAL. The older variants still work but are considered deprecated.
(metadata file internal format breaking change) (doesn't affect users of this library) If anyone was using metadata files from this library bypassing the library functions (i.e. those who parsed metadata.min.json file manually) then there's a new internal optimization introduced in this version: previously formats were copy-pasted for each country of the same region (e.g. NANPA) while now the formats are only defined on the "main" country for region and other countries simply read the formats from it at runtime. This reduced the default metadata file size by 5 kilobytes.
Nothing published for this version
Nothing published for this version
Deprecated findPhoneNumbers(), searchPhoneNumbers() and PhoneNumberSearch. Use findNumbers(), searchNumbers() and PhoneNumberMatcher instead. The now-…
findPhoneNumbers(), searchPhoneNumbers() and PhoneNumberSearch. Use findNumbers(), searchNumbers() and PhoneNumberMatcher instead. The now-deprecated functions were a half-self-made implementation of Google's Java findNumbers() until the Java code was ported into javascript and passed tests. The port of Google's Java implementation is supposed to find numbers more correctly. It hasn't been tested by users in production yet, but the same tests as for the previous implementation of findPhoneNumbers() pass, so seems that it can be used in production.Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed formatNumber('NATIONAL') not formatting national phone numbers with a national prefix when it's marked as optional (e.g. Russia). Before it didn
formatNumber('NATIONAL') not formatting national phone numbers with a national prefix when it's marked as optional (e.g. Russia). Before it didn't add national prefix when formatting national numbers if national prefix was marked as optional. Now it always adds national prefix when formatting national numbers even when national prefix is marked as optional.A bug in matches_entirely was found by a user which resulted in incorrect regexp matching in some cases, e.g. when there was a | in a regexp. This cou
matches_entirely was found by a user which resulted in incorrect regexp matching in some cases, e.g. when there was a | in a regexp. This could cause incorrect parseNumber() results, or any other weird behaviour.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
(could be a breaking change for those who somehow used .template property of an AsYouType instance) Due to the change in AsYouType formatting the .tem…
Changed the output of AsYouType formatter. E.g. before for US and input 21 it was outputting (21 ) which is not good for phone number input (not intuitive and is confusing). Now it will not add closing braces which haven't been reached yet by the input cursor and it will also strip the corresponding opening braces, so for US and input 21 it now is just 21, and for 213 it is (213).
.template property of an AsYouType instance) Due to the change in AsYouType formatting the .template property no longer strictly corresponds to the output, e.g. for US and input 21 the output is now 21 but the .template is still (xxx) xxx-xxxx like it used to be in the older versions when the output was (21 ). Therefore, a new function has been added to AsYouType instance called .getTemplate() which will return the partial template for the currently input value, so for input 21 the output will be 21 and .getTemplate() will return xx, and for input 213 the output will be (213) and .getTemplate() will return (xxx). So there is this difference between the new .getTemplate() function and the old .template property: the old .template property always returns the template for a fully entered phone number and the new .getTemplate() function always returns the template for the partially entered phone number, i.e. for the partially entered number (213) 45 it will return template (xxx) xx so it's a one-to-one correspondence now.Nothing published for this version
Nothing published for this version
Fixed parseNumber(), isValidNumber() and getNumberType() in some rare cases (made them a bit less strict where it fits): previously they were treating
Fixed parseNumber(), isValidNumber() and getNumberType() in some rare cases (made them a bit less strict where it fits): previously they were treating defaultCountry argument as "the country" in case of local numbers, e.g. isValidNumber('07624 369230', 'GB') would be false because 07624 369230 number belongs to IM (the Isle of Man). While IM is not GB it should still be true because GB is the default country, without it necessarily being the country.
isValidNumberForRegion(number, country) which mimics Google's libphonenumber's one.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed a previously unnoticed bug regarding parsing RFC3966 phone URIs: previously : was mistakenly being considered a key-value separator instead of =
: was mistakenly being considered a key-value separator instead of =. E.g. it was parsing RFC3966 phone numbers as tel:+78005553535;ext:123 instead of tel:+78005553535;ext=123. The bug was found and reported by @cdunn.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.