libphonenumber-csharp 8.13.15

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package libphonenumber-csharp --version 8.13.15
                    
NuGet\Install-Package libphonenumber-csharp -Version 8.13.15
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="libphonenumber-csharp" Version="8.13.15" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="libphonenumber-csharp" Version="8.13.15" />
                    
Directory.Packages.props
<PackageReference Include="libphonenumber-csharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add libphonenumber-csharp --version 8.13.15
                    
#r "nuget: libphonenumber-csharp, 8.13.15"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=libphonenumber-csharp&version=8.13.15
                    
Install libphonenumber-csharp as a Cake Addin
#tool nuget:?package=libphonenumber-csharp&version=8.13.15
                    
Install libphonenumber-csharp as a Cake Tool

Build status codecov NuGet

C# port of Google's libphonenumber library.

The code was rewritten from the Java source mostly unchanged, please refer to the original documentation for sample code and API documentation.

The original Apache License 2.0 was preserved.

See this for details about the port.

Phonenumber metadata is updated in the Google repo approximately every two weeks. This library is manually updated to include the latest metadata, usually within a day or so. There is currently plans to fully automate this https://github.com/twcclegg/libphonenumber-csharp/issues/172

Example

  var phoneNumberUtil = PhoneNumbers.PhoneNumberUtil.GetInstance();
  var e164PhoneNumber = "+44 117 496 0123";
  var nationalPhoneNumber = "2024561111";
  var smsShortNumber = "83835";
  var phoneNumber = phoneNumberUtil.Parse(e164PhoneNumber, null);
  phoneNumber = phoneNumberUtil.Parse(nationalPhoneNumber, "US");
  phoneNumber = phoneNumberUtil.Parse(smsShortNumber, "US");

Features

  • Parsing/formatting/validating phone numbers for all countries/regions of the world.
  • GetNumberType - gets the type of the number based on the number itself; able to distinguish Fixed-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP and Personal Numbers (whenever feasible).
  • IsNumberMatch - gets a confidence level on whether two numbers could be the same.
  • GetExampleNumber/GetExampleNumberByType - provides valid example numbers for 218 countries/regions, with the option of specifying which type of example phone number is needed.
  • IsPossibleNumber - quickly guessing whether a number is a possible phonenumber by using only the length information, much faster than a full validation.
  • AsYouTypeFormatter - formats phone numbers on-the-fly when users enter each digit.
  • FindNumbers - finds numbers in text input

ToDo

  • port read/write source xml data to binary for better performance and smaller .nupkg size (WIP)
  • update / add / port new unit tests and logging from java source

How to unfold automatic generated files

  • Install Jetbrains - Resharper for Visual Studio
  • File by file, right click and "Cleanup code"
  • Check the unfolded file

Available on NuGet as package libphonenumber-csharp.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (127)

Showing the top 5 NuGet packages that depend on libphonenumber-csharp:

Package Downloads
N3O.Umbraco.Validation

TODO

NanoCore

The project is inspired by years of tedious repetitions, continuously re-writing similar code-snippets and libraries, to handle common functionality, not related to the business domain, such as logging, data persistence, message queuing, documentation, validation and similar.

OrchardCore.Users

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The Users module adds user management functionality.

OrchardCore.Application.Cms.Core.Targets

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with TheAdmin theme but without any front-end Themes.

TheTheme

Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The default Theme - Can be used as base theme for new themes.

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on libphonenumber-csharp:

Repository Stars
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
ONLYOFFICE/CommunityServer
Free open source office suite with business productivity tools: document and project management, CRM, mail aggregator.
bitfoundation/bitplatform
Build all of your apps using what you already know and love ❤️
notifo-io/notifo
Multi channel notification service for collaboration tools, e-commerce, news service and more.
shr670377723/CommunityServer-master
Version Downloads Last updated
9.0.6 7,700 5/28/2025
9.0.5 94,129 5/8/2025
9.0.4 109,298 4/25/2025
9.0.3 101,614 4/11/2025
9.0.2 165,269 3/28/2025
9.0.1 50,003 3/23/2025
8.13.55 662,920 2/14/2025
8.13.54 225,427 1/31/2025
8.13.53 169,844 1/21/2025
8.13.52 703,767 12/13/2024
8.13.51 282,247 12/2/2024
8.13.50 505,466 11/16/2024
8.13.49 339,123 11/4/2024
8.13.48 174,956 10/23/2024
8.13.47 737,074 10/4/2024
8.13.46 297,388 9/25/2024
8.13.45 520,767 9/6/2024
8.13.44 359,580 8/26/2024
8.13.43 532,774 8/9/2024
8.13.42 277,804 7/26/2024
8.13.41 29,624 7/25/2024
8.13.40 662,692 7/3/2024
8.13.39 462,741 6/15/2024
8.13.38 242,479 6/5/2024
8.13.37 1,134,174 5/17/2024
8.13.36 313,045 5/3/2024
8.13.35 428,609 4/19/2024
8.13.34 431,429 4/5/2024
8.13.33 470,122 3/25/2024
8.13.32 433,913 3/12/2024
8.13.31 284,357 2/25/2024
8.13.30 433,959 2/9/2024
8.13.29 446,252 1/26/2024
8.13.28 25,180 1/25/2024
8.13.27 866,744 12/21/2023
8.13.26 657,962 11/29/2023
8.13.25 390,091 11/20/2023
8.13.24 738,932 10/31/2023
8.13.23 462,304 10/17/2023
8.13.22 457,045 9/29/2023
8.13.21 239,066 9/20/2023
8.13.20 372,055 9/7/2023
8.13.19 364,529 8/22/2023
8.13.18 431,389 8/3/2023
8.13.17 153,146 7/27/2023
8.13.16 247,789 7/11/2023
8.13.15 2,172 7/11/2023
8.13.14 743,967 6/15/2023
8.13.13 2,126 6/15/2023
8.13.12 2,111 6/15/2023
8.13.11 1,285,018 4/27/2023
8.13.10 135,748 4/20/2023
8.13.9 251,854 4/10/2023
8.13.8 211,790 3/27/2023
8.13.7 915,608 3/3/2023
8.13.6 587,157 2/10/2023
8.13.5 256,762 1/29/2023
8.13.4 427,676 1/9/2023
8.13.3 499,650 12/22/2022
8.13.2 733,522 12/8/2022
8.13.1 267,186 11/28/2022
8.13.0 579,777 11/8/2022
8.12.57 906,372 10/14/2022
8.12.56 868,657 9/23/2022
8.12.55 556,667 9/9/2022
8.12.54 463,579 8/22/2022
8.12.53 536,768 8/8/2022
8.12.52 521,880 7/19/2022
8.12.51.1 159,922 7/12/2022
8.12.50 888,531 6/13/2022
8.12.49 420,546 6/1/2022
8.12.48 330,578 5/18/2022
8.12.47 6,839 5/18/2022
8.12.46 890,644 4/15/2022
8.12.45 1,199,890 3/14/2022
8.12.44 106,044 3/9/2022
8.12.43 593,397 2/14/2022
8.12.42 2,062 2/14/2022
8.12.41 2,072 2/14/2022
8.12.40 2,170 2/14/2022
8.12.39 2,135 2/14/2022
8.12.38 1,864,522 12/15/2021
8.12.37 2,634 12/15/2021
8.12.36 2,494 12/15/2021
8.12.35 2,256 12/15/2021
8.12.34 1,974,095 10/7/2021
8.12.33 439,539 9/23/2021
8.12.32 240,984 9/11/2021
8.12.31 2,605 9/11/2021
8.12.30 313,492 8/18/2021
8.12.29 2,393 8/18/2021
8.12.28 501,111 7/23/2021
8.12.27 271,006 7/8/2021
8.12.26 187,230 6/25/2021
8.12.25 144,115 6/16/2021
8.12.24 884,493 5/31/2021
8.12.23 265,075 5/13/2021
8.12.22 455,779 4/30/2021
8.12.21 396,511 4/8/2021
8.12.19 640,366 3/2/2021
8.12.18 544,000 2/10/2021
8.12.17 269,332 1/27/2021
8.12.16 150,409 1/15/2021
8.12.15 529,592 12/18/2020
8.12.14 337,948 12/4/2020
8.12.13 521,713 11/18/2020
8.12.11 1,123,258 10/9/2020
8.12.10 197,414 9/29/2020
8.12.9 428,632 9/2/2020
8.12.8 477,689 8/17/2020
8.12.7 541,133 7/21/2020
8.12.6 197,806 7/6/2020
8.12.5 2,717 7/6/2020
8.12.4 549,694 5/21/2020
8.12.3 210,328 5/8/2020
8.12.2 239,884 4/23/2020
8.12.1 559,846 3/31/2020
8.12.0 294,733 3/20/2020
8.11.5 324,182 3/3/2020
8.11.4 309,436 2/13/2020
8.11.3 294,893 2/3/2020
8.11.2 883,558 1/16/2020
8.11.1 419,589 12/12/2019
8.11.0 135,569 11/29/2019
8.10.23 98,607 11/18/2019
8.10.22 55,914 11/14/2019
8.10.21 457,726 10/17/2019
8.10.20 207,262 10/3/2019
8.10.19 207,762 9/21/2019
8.10.18 48,634 9/17/2019
8.10.17 304,446 8/16/2019
8.10.16 95,120 8/5/2019
8.10.15 205,082 7/18/2019
8.10.14 239,970 7/1/2019
8.10.13 467,369 5/31/2019
8.10.12 274,995 5/15/2019
8.10.11 86,295 5/7/2019
8.10.10 138,314 4/17/2019
8.10.9 256,628 4/5/2019
8.10.8 117,585 3/23/2019
8.10.7 149,854 3/11/2019
8.10.6 154,985 2/22/2019
8.10.5 508,149 2/8/2019
8.10.4 204,845 1/25/2019
8.10.3 145,837 1/11/2019
8.10.2 385,149 12/7/2018
8.10.1 65,113 11/29/2018
8.10.0 41,059 11/29/2018
8.9.16 640,089 10/19/2018
8.9.15 122,149 10/6/2018
8.9.14 94,847 9/21/2018
8.9.13 117,808 9/7/2018
8.9.12 231,134 8/25/2018
8.9.11 104,857 8/18/2018
8.9.10 327,755 7/12/2018
8.9.9 89,039 6/29/2018
8.9.8 71,829 6/15/2018
8.9.7 89,956 5/30/2018
8.9.6 140,367 5/16/2018
8.9.5 39,399 5/4/2018
8.9.4 110,316 4/17/2018
8.9.3 42,028 4/5/2018
8.9.2 74,201 3/19/2018
8.9.1 35,269 3/8/2018
8.9.0 50,077 2/22/2018
8.8.11 65,261 2/8/2018
8.8.10 37,367 1/25/2018
8.8.9 232,478 1/10/2018
8.8.8 151,171 12/8/2017
8.8.7 30,862 12/1/2017
8.8.6 71,430 11/17/2017
8.8.5 192,320 10/31/2017
8.8.4 142,261 10/17/2017
8.8.3 67,123 10/6/2017
8.8.2 54,986 9/22/2017
8.8.1 48,385 9/8/2017
8.8.0 141,632 8/22/2017
8.7.1 46,882 8/3/2017
8.7.0.1 57,338 7/21/2017
8.6.0.1 4,869 7/18/2017
8.6.0 46,656 7/10/2017
8.3.1.2 102,051 6/24/2017
8.3.1.1 130,597 3/13/2017
8.3.1 21,790 3/4/2017
7.7.4 349,105 11/13/2016
7.5.1 440,223 8/6/2016
7.2.5 473,271 2/11/2016
7.0.11 157,708 10/5/2015
7.0.9 85,645 8/16/2015
7.0.5.5 80,542 5/27/2015
7.0.5.4 3,360 5/23/2015
7.0.5.3 19,231 4/28/2015
7.0.5.1 3,177 4/27/2015
7.0.5 3,437 4/25/2015
4.10.0.62 325,899 8/21/2012
4.10.0.61 3,303 8/9/2012
4.10.0.59 3,476 7/27/2012
4.10.0.55 3,471 7/19/2012
4.9.0.52 3,389 7/13/2012
4.9.0.43 3,272 7/10/2012
4.9.0.42 3,413 7/9/2012
4.8.0.35 4,647 6/22/2012
4.8.0.33 4,292 6/16/2012
4.8.0.31 3,403 6/7/2012
4.8.0.30 4,254 5/31/2012
4.8.0.24 3,817 5/9/2012
4.7.0.21 4,712 4/28/2012
4.7.0.19 3,382 4/25/2012
4.6.0.16 3,720 3/30/2012
4.6.0.13 14,287 2/10/2012
4.5.0.9 7,354 1/30/2012
4.5.0.6 3,461 1/21/2012
4.5.0.4 4,340 1/20/2012
4.4.0.1 32,602 1/10/2012
3.8.0.400 3,539 11/28/2011
3.8.0.399 3,467 11/27/2011
3.8.0.394 3,540 11/24/2011
3.8.0.342 3,596 9/17/2011
3.7.1.342 3,489 9/17/2011
3.7.1.312 3,447 8/5/2011
3.7.1.306 18,258 8/5/2011