.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package Hardware.Info --version
NuGet\Install-Package Hardware.Info -Version
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="Hardware.Info" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hardware.Info --version
#r "nuget: Hardware.Info,"
#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.
// Install Hardware.Info as a Cake Addin
#addin nuget:?package=Hardware.Info&version=

// Install Hardware.Info as a Cake Tool
#tool nuget:?package=Hardware.Info&version=


Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, motherboard, mouse, NIC - network adapter, printer, sound card - audio card, graphics card - video card. Hardware.Info is a .NET Standard 2.0 library and uses WMI on Windows, /dev, /proc, /sys on Linux and sysctl, system_profiler on macOS.

How to use:

  1. Include NuGet package from https://www.nuget.org/packages/Hardware.Info

         <PackageReference Include="Hardware.Info" Version="" />
  2. Call RefreshAll() or one of the other Refresh*() methods:

     class Program
         static readonly IHardwareInfo hardwareInfo = new HardwareInfo();
         static void Main(string[] _)
             foreach (var hardware in hardwareInfo.BatteryList)
             foreach (var hardware in hardwareInfo.BiosList)
             foreach (var cpu in hardwareInfo.CpuList)
                 foreach (var cpuCore in cpu.CpuCoreList)
             foreach (var drive in hardwareInfo.DriveList)
                 foreach (var partition in drive.PartitionList)
                     foreach (var volume in partition.VolumeList)
             foreach (var hardware in hardwareInfo.KeyboardList)
             foreach (var hardware in hardwareInfo.MemoryList)
             foreach (var hardware in hardwareInfo.MonitorList)
             foreach (var hardware in hardwareInfo.MotherboardList)
             foreach (var hardware in hardwareInfo.MouseList)
             foreach (var hardware in hardwareInfo.NetworkAdapterList)
             foreach (var hardware in hardwareInfo.PrinterList)
             foreach (var hardware in hardwareInfo.SoundDeviceList)
             foreach (var hardware in hardwareInfo.VideoControllerList)
             foreach (var address in HardwareInfo.GetLocalIPv4Addresses(NetworkInterfaceType.Ethernet, OperationalStatus.Up))
             foreach (var address in HardwareInfo.GetLocalIPv4Addresses(NetworkInterfaceType.Wireless80211))
             foreach (var address in HardwareInfo.GetLocalIPv4Addresses(OperationalStatus.Up))
             foreach (var address in HardwareInfo.GetLocalIPv4Addresses())

Known issues

21 second delay on first use in Windows

Hardware.Info uses WMI (Windows Management Instrumentation) on Windows OS. For certain queries WMI takes 21 seconds to initialize the first time you use it, after that all subsequent queries will execute immediately. If WMI isn't used for 15 minutes it will have to be initialized again the next time you use it.

The 21 second initialization delay is caused by RPC that WMI uses internally. In RPC documentation it says that the RPC/TCP time-out interval is defined with a SCMApiConnectionParam registry value located at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control and that the default value is set to 21,000 (21 seconds).

You can avoid the 21 second delay by excluding the queries that cause it (see Settings).


Constructor settings:

HardwareInfo(bool useAsteriskInWMI = true, TimeSpan? timeoutInWMI = null)

The construcotr accepts two settings for WMI:

  • useAsteriskInWMI causes WMI queries to use SELECT * FROM instead of SELECT with a list of property names. This is slower, but safer, more compatible with older Windows (XP, Vista, 7, 8) where a certain WMI property might be missing and throw an exception when queried by name. The default value is true.
  • timeoutInWMI sets the Timeout property of the EnumerationOptions in the ManagementObjectSearcher that executes the query. The default value is EnumerationOptions.InfiniteTimeout. Changing this could cause the query to return empty results in certain cases.

Refresh methods settings:

In these two methods you can exclude some slow queries by setting the parameters to false:

RefreshCPUList(bool includePercentProcessorTime = true)

RefreshNetworkAdapterList(bool includeBytesPersec = true, bool includeNetworkAdapterConfiguration = true)

Setting includePercentProcessorTime and includeBytesPersec to false will exclude the queries that:

  • cause a 21 second delay the first time they are called in Windows
  • cause a 1 second delay every time they are called in Linux

Setting includeNetworkAdapterConfiguration to false has only a small impact on performance.


Windows 8.1 (Intel i5-2500, 8 GB RAM):

Method Mean Error StdDev
RefreshMemoryStatus 947.8 ns 3.77 ns 3.53 ns
RefreshBatteryList 1,811,885.7 ns 12,921.05 ns 11,454.17 ns
RefreshBIOSList 2,086,001.0 ns 23,896.69 ns 22,352.98 ns
RefreshCPUList 1,543,579,005.2 ns 2,405,376.47 ns 2,132,303.59 ns
RefreshDriveList 409,137,516.3 ns 8,612,410.99 ns 25,258,710.57 ns
RefreshKeyboardList 5,568,039.5 ns 44,228.57 ns 41,371.43 ns
RefreshMemoryList 2,120,024.5 ns 26,103.39 ns 24,417.13 ns
RefreshMonitorList 5,669,237.8 ns 50,801.76 ns 45,034.44 ns
RefreshMotherboardList 1,965,222.9 ns 14,387.30 ns 13,457.89 ns
RefreshMouseList 6,003,924.9 ns 60,725.05 ns 50,708.17 ns
RefreshNetworkAdapterList 1,412,244,738.6 ns 14,681,615.28 ns 12,259,813.69 ns
RefreshPrinterList 28,244,822.2 ns 143,359.60 ns 134,098.66 ns
RefreshSoundDeviceList 3,608,577.5 ns 68,688.62 ns 73,496.06 ns
RefreshVideoControllerList 11,568,549.2 ns 54,666.07 ns 48,460.05 ns

Version history:

    • Fixed PercentProcessorTime in Windows - thanks to @C6OI
    • Added GetOperatingSystem() in Windows, macOS, Linux - thanks to @adhip94
    • Fixed GetDriveList() and GetMemoryList() in Linux - thanks to @misaka00251
    • Added Memory.BankLabel, Memory.MinVoltage, Memory.MaxVoltage in Windows - by @AathifMahir
    • Added CPU.SocketDesignation, CPU.SecondLevelAddressTranslationExtensions in Windows - by @AathifMahir
    • Added Windows version check for WMI properties that require at least Windows 8
    • Added Windows version check for WMI properties that require at least Windows 10
    • Added XML summary for public properties in every class.
    • Added IHardwareInfo so that HardwareInfo can be mocked - by @240026763
    • Added two settings for WMI queries in Windows
    • Added three settings to exclude slow queries in Windows, macOS, Linux
    • Fixed reading MemAvailable instead of MemFree in Linux - by @schotime
    • Added CpuCore info in Linux - by @isenmann
    • Added CPU.PercentProcessorTime, CPU.CpuCoreList in Linux - by @isenmann
    • Added CpuCore info in Windows - by @isenmann
    • Added CPU.PercentProcessorTime, CPU.CpuCoreList in Windows - by @isenmann
    • Added NetworkAdapter.BytesSentPersec, NetworkAdapter.BytesReceivedPersec in Windows - by @isenmann
    • Added Battery.EstimatedChargeRemaining in Windows, Linux - by @reptail
    • Added Battery.ExpectedLife in Linux
    • Added Battery.EstimatedRunTime in Linux
    • Added Battery.MaxRechargeTime in Linux
    • Added Battery.TimeToFullCharge in Linux
    • Added Battery.DesignCapacity in Linux
    • Added Battery.FullChargeCapacity in Linux
    • Added Battery.BatteryStatusDescription in Linux
    • Added Monitor info in macOS
    • Added VideoController info in macOS
    • Added CPU.L2CacheSize in macOS
    • Added CPU.L3CacheSize in macOS
    • Added Memory info in macOS
    • Added BIOS.ReleaseDate in Linux
    • Added CPU.Manufacturer in Linux
    • Added CPU.L3CacheSize in Linux
    • Added Motherboard.SerialNumber in Linux
    • Fixed NetworkAdapter info in Linux
    • Fixed GetLocalIPv4Addresses() in macOS
    • Added GetLocalIPv4Addresses() in Windows, macOS, Linux
    • Added Motherboard.SerialNumber in Windows
    • Added Drive, NetworkAdapter info in macOS, Linux
    • All hardware info in Windows
    • CPU, RAM info in macOS, Linux
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Hardware.Info:

Package Downloads

Merkop Test is a free, open source, focused testing tool for the ASP.NET Framework.


Extensions to aid in development.


Package Description


Get Hardware information synchronously and asynchronously.


A library for create virtual disk drive on system memory using (c) PassMark OSFMount software.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Hardware.Info:

Repository Stars
PixiEditor is a lightweight pixel art editor made with .NET 7
Version Downloads Last updated
11.0.0 332 3/25/2023 1,411 3/12/2023
10.1.1 11,750 1/13/2023 4,195 12/6/2022
10.1.0 18,109 10/15/2022 5,602 10/2/2022
10.0.1 19,169 6/4/2022 10,206 4/29/2022
10.0.0 32,329 2/3/2022 39,488 9/12/2021
1.1.1 803 8/25/2021 258 8/23/2021
1.1.0 1,080 8/7/2021 12,300 5/17/2021
1.0.1 400 4/27/2021 1,966 1/23/2021
1.0.0 964 12/19/2020 1,408 12/12/2020
0.1.1 323 12/6/2020 599 9/27/2020
0.1.0 439 9/13/2020 393 8/7/2020
0.0.1 366 7/29/2020 390 7/21/2020