libphonenumber-csharp 8.13.32

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.32
                    
NuGet\Install-Package libphonenumber-csharp -Version 8.13.32
                    
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.32" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="libphonenumber-csharp" Version="8.13.32" />
                    
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.32
                    
#r "nuget: libphonenumber-csharp, 8.13.32"
                    
#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.32
                    
Install libphonenumber-csharp as a Cake Addin
#tool nuget:?package=libphonenumber-csharp&version=8.13.32
                    
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.

Phone number metadata is updated in the Google repo approximately every two weeks. This library is automatically updated by a scheduled github action to include the latest metadata, usually within a day.

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.

Buy me a beer

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 (128)

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 14,192 5/28/2025
9.0.5 100,414 5/8/2025
9.0.4 113,703 4/25/2025
9.0.3 103,844 4/11/2025
9.0.2 167,702 3/28/2025
9.0.1 51,175 3/23/2025
8.13.55 673,061 2/14/2025
8.13.54 227,720 1/31/2025
8.13.53 170,636 1/21/2025
8.13.52 711,613 12/13/2024
8.13.51 284,011 12/2/2024
8.13.50 508,553 11/16/2024
8.13.49 341,493 11/4/2024
8.13.48 175,745 10/23/2024
8.13.47 741,495 10/4/2024
8.13.46 299,073 9/25/2024
8.13.45 522,697 9/6/2024
8.13.44 361,310 8/26/2024
8.13.43 534,956 8/9/2024
8.13.42 278,734 7/26/2024
8.13.41 29,702 7/25/2024
8.13.40 665,438 7/3/2024
8.13.39 464,613 6/15/2024
8.13.38 243,151 6/5/2024
8.13.37 1,143,424 5/17/2024
8.13.36 314,005 5/3/2024
8.13.35 429,752 4/19/2024
8.13.34 432,498 4/5/2024
8.13.33 472,691 3/25/2024
8.13.32 435,599 3/12/2024
8.13.31 284,778 2/25/2024
8.13.30 434,979 2/9/2024
8.13.29 446,907 1/26/2024
8.13.28 25,221 1/25/2024
8.13.27 869,131 12/21/2023
8.13.26 659,397 11/29/2023
8.13.25 390,442 11/20/2023
8.13.24 740,267 10/31/2023
8.13.23 463,317 10/17/2023
8.13.22 457,583 9/29/2023
8.13.21 239,421 9/20/2023
8.13.20 372,742 9/7/2023
8.13.19 365,100 8/22/2023
8.13.18 431,706 8/3/2023
8.13.17 153,257 7/27/2023
8.13.16 247,922 7/11/2023
8.13.15 2,174 7/11/2023
8.13.14 744,603 6/15/2023
8.13.13 2,127 6/15/2023
8.13.12 2,112 6/15/2023
8.13.11 1,287,086 4/27/2023
8.13.10 135,908 4/20/2023
8.13.9 252,200 4/10/2023
8.13.8 212,106 3/27/2023
8.13.7 917,847 3/3/2023
8.13.6 587,533 2/10/2023
8.13.5 256,804 1/29/2023
8.13.4 428,111 1/9/2023
8.13.3 500,503 12/22/2022
8.13.2 733,958 12/8/2022
8.13.1 267,361 11/28/2022
8.13.0 580,170 11/8/2022
8.12.57 907,454 10/14/2022
8.12.56 869,187 9/23/2022
8.12.55 557,143 9/9/2022
8.12.54 463,807 8/22/2022
8.12.53 537,322 8/8/2022
8.12.52 522,250 7/19/2022
8.12.51.1 160,029 7/12/2022
8.12.50 889,159 6/13/2022
8.12.49 420,756 6/1/2022
8.12.48 330,767 5/18/2022
8.12.47 6,841 5/18/2022
8.12.46 891,901 4/15/2022
8.12.45 1,200,452 3/14/2022
8.12.44 106,058 3/9/2022
8.12.43 594,158 2/14/2022
8.12.42 2,064 2/14/2022
8.12.41 2,073 2/14/2022
8.12.40 2,172 2/14/2022
8.12.39 2,136 2/14/2022
8.12.38 1,865,718 12/15/2021
8.12.37 2,639 12/15/2021
8.12.36 2,496 12/15/2021
8.12.35 2,258 12/15/2021
8.12.34 1,975,845 10/7/2021
8.12.33 439,766 9/23/2021
8.12.32 241,111 9/11/2021
8.12.31 2,607 9/11/2021
8.12.30 313,678 8/18/2021
8.12.29 2,395 8/18/2021
8.12.28 501,347 7/23/2021
8.12.27 271,091 7/8/2021
8.12.26 187,774 6/25/2021
8.12.25 144,165 6/16/2021
8.12.24 885,271 5/31/2021
8.12.23 265,258 5/13/2021
8.12.22 456,583 4/30/2021
8.12.21 396,802 4/8/2021
8.12.19 640,689 3/2/2021
8.12.18 544,580 2/10/2021
8.12.17 269,369 1/27/2021
8.12.16 150,423 1/15/2021
8.12.15 529,838 12/18/2020
8.12.14 338,114 12/4/2020
8.12.13 521,816 11/18/2020
8.12.11 1,123,640 10/9/2020
8.12.10 197,449 9/29/2020
8.12.9 428,705 9/2/2020
8.12.8 477,884 8/17/2020
8.12.7 541,381 7/21/2020
8.12.6 197,835 7/6/2020
8.12.5 2,718 7/6/2020
8.12.4 549,870 5/21/2020
8.12.3 210,391 5/8/2020
8.12.2 239,931 4/23/2020
8.12.1 560,268 3/31/2020
8.12.0 294,789 3/20/2020
8.11.5 324,260 3/3/2020
8.11.4 309,531 2/13/2020
8.11.3 294,944 2/3/2020
8.11.2 883,709 1/16/2020
8.11.1 419,764 12/12/2019
8.11.0 135,688 11/29/2019
8.10.23 98,638 11/18/2019
8.10.22 55,918 11/14/2019
8.10.21 458,003 10/17/2019
8.10.20 207,426 10/3/2019
8.10.19 207,945 9/21/2019
8.10.18 48,646 9/17/2019
8.10.17 304,529 8/16/2019
8.10.16 95,137 8/5/2019
8.10.15 205,108 7/18/2019
8.10.14 240,560 7/1/2019
8.10.13 467,461 5/31/2019
8.10.12 275,116 5/15/2019
8.10.11 86,372 5/7/2019
8.10.10 138,359 4/17/2019
8.10.9 256,662 4/5/2019
8.10.8 117,619 3/23/2019
8.10.7 149,875 3/11/2019
8.10.6 155,079 2/22/2019
8.10.5 508,337 2/8/2019
8.10.4 204,971 1/25/2019
8.10.3 145,934 1/11/2019
8.10.2 385,385 12/7/2018
8.10.1 65,118 11/29/2018
8.10.0 41,169 11/29/2018
8.9.16 641,009 10/19/2018
8.9.15 122,157 10/6/2018
8.9.14 94,870 9/21/2018
8.9.13 117,816 9/7/2018
8.9.12 231,176 8/25/2018
8.9.11 104,945 8/18/2018
8.9.10 327,942 7/12/2018
8.9.9 89,057 6/29/2018
8.9.8 71,844 6/15/2018
8.9.7 90,026 5/30/2018
8.9.6 140,450 5/16/2018
8.9.5 39,435 5/4/2018
8.9.4 110,348 4/17/2018
8.9.3 42,045 4/5/2018
8.9.2 74,224 3/19/2018
8.9.1 35,285 3/8/2018
8.9.0 50,092 2/22/2018
8.8.11 65,344 2/8/2018
8.8.10 37,380 1/25/2018
8.8.9 232,715 1/10/2018
8.8.8 151,201 12/8/2017
8.8.7 30,871 12/1/2017
8.8.6 71,453 11/17/2017
8.8.5 192,512 10/31/2017
8.8.4 142,294 10/17/2017
8.8.3 67,159 10/6/2017
8.8.2 55,033 9/22/2017
8.8.1 48,395 9/8/2017
8.8.0 141,690 8/22/2017
8.7.1 46,905 8/3/2017
8.7.0.1 57,350 7/21/2017
8.6.0.1 4,877 7/18/2017
8.6.0 46,716 7/10/2017
8.3.1.2 102,085 6/24/2017
8.3.1.1 130,641 3/13/2017
8.3.1 21,806 3/4/2017
7.7.4 349,197 11/13/2016
7.5.1 440,526 8/6/2016
7.2.5 473,544 2/11/2016
7.0.11 157,775 10/5/2015
7.0.9 85,675 8/16/2015
7.0.5.5 80,556 5/27/2015
7.0.5.4 3,369 5/23/2015
7.0.5.3 19,252 4/28/2015
7.0.5.1 3,186 4/27/2015
7.0.5 3,446 4/25/2015
4.10.0.62 326,143 8/21/2012
4.10.0.61 3,313 8/9/2012
4.10.0.59 3,485 7/27/2012
4.10.0.55 3,480 7/19/2012
4.9.0.52 3,398 7/13/2012
4.9.0.43 3,281 7/10/2012
4.9.0.42 3,422 7/9/2012
4.8.0.35 4,660 6/22/2012
4.8.0.33 4,303 6/16/2012
4.8.0.31 3,412 6/7/2012
4.8.0.30 4,263 5/31/2012
4.8.0.24 3,826 5/9/2012
4.7.0.21 4,721 4/28/2012
4.7.0.19 3,391 4/25/2012
4.6.0.16 3,729 3/30/2012
4.6.0.13 14,298 2/10/2012
4.5.0.9 7,364 1/30/2012
4.5.0.6 3,470 1/21/2012
4.5.0.4 4,350 1/20/2012
4.4.0.1 32,626 1/10/2012
3.8.0.400 3,548 11/28/2011
3.8.0.399 3,476 11/27/2011
3.8.0.394 3,549 11/24/2011
3.8.0.342 3,605 9/17/2011
3.7.1.342 3,498 9/17/2011
3.7.1.312 3,457 8/5/2011
3.7.1.306 18,292 8/5/2011