MacToVendorLookup 1.0.0

dotnet add package MacToVendorLookup --version 1.0.0
                    
NuGet\Install-Package MacToVendorLookup -Version 1.0.0
                    
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="MacToVendorLookup" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MacToVendorLookup" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MacToVendorLookup" />
                    
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 MacToVendorLookup --version 1.0.0
                    
#r "nuget: MacToVendorLookup, 1.0.0"
                    
#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.
#:package MacToVendorLookup@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MacToVendorLookup&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MacToVendorLookup&version=1.0.0
                    
Install as a Cake Tool

MacToVendorLookup

CI NuGet Downloads License: MIT

Give it a MAC address in any format, get back the hardware vendor.

The complete IEEE registry ships inside the package — 53,700 assignments, 30,650 vendors. No HTTP calls, no API key, no rate limits, no external service, and no package dependencies.

using MacToVendorLookup;

MacVendorLookup.GetVendorName("48-46-FB-11-22-33");   // "HUAWEI TECHNOLOGIES CO.,LTD"
MacVendorLookup.GetVendorName("000c.4201.0203");      // "Routerboard.com"
MacVendorLookup.GetVendorName("b827eb000001");        // "Raspberry Pi Foundation"

Install

dotnet add package MacToVendorLookup

Targets netstandard2.0 and net8.0 — runs on .NET Framework 4.6.1+, .NET Core, .NET 5+, Mono and Unity.

Usage

Everything is static. Nothing to register, inject, configure or dispose.

MacLookupResult result = MacVendorLookup.Lookup("48-46-FB-11-22-33");

result.IsValid;        // true  -- it parsed
result.IsFound;        // true  -- a vendor owns it
result.VendorName;     // "HUAWEI TECHNOLOGIES CO.,LTD"
result.NormalizedMac;  // "48:46:FB:11:22:33"
result.Oui;            // "48:46:FB"

Any format in

Colons, hyphens, dots, underscores, spaces or nothing at all — mixed separators, any casing, an optional 0x prefix, and stray whitespace. These all parse to the same address:

Input
48:46:FB:11:22:33 colon-separated
48-46-FB-11-22-33 hyphen-separated (IEEE / Windows)
4846.FB11.2233 dotted quads (Cisco)
4846FB112233 no separators
48 46 fb 11 22 33 space-separated, lower case
48_46_FB_11_22_33 underscore-separated
0x4846FB112233 hex-literal prefix
48:46-FB.11 22_33 mixed separators

Bare OUI prefixes (48:46:FB) and EUI-64 addresses also work. Addresses pasted out of a router UI, an OLT export, a DHCP lease table, a spreadsheet or a log file need no cleaning up first.

Validation

Bad input never throws — the reason comes back on the result:

MacLookupResult result = MacVendorLookup.Lookup("48:46:FB:11:22");

result.IsValid;       // false
result.Error;         // MacLookupError.InvalidLength
result.ErrorMessage;  // "48:46:FB:11:22" does not hold 6, 12 or 16 hex digits, ...
MacLookupError Meaning
None Parsed and resolved.
EmptyInput null, empty, or only separators.
InvalidCharacters Something that is neither a hex digit nor a separator.
InvalidLength Not 6, 12 or 16 hex digits.
VendorNotFound Well-formed, but the IEEE has not assigned it.

IsValid means it parsed; IsFound means a vendor was resolved. A real-but-unassigned address is valid and not found. To check a string on its own: MacVendorLookup.IsValidMac(input).

Bulk

Results line up positionally with the input, so bad entries are reported in place rather than dropped:

MacLookupResult[] results = MacVendorLookup.LookupMany(macs);

Other entry points:

MacVendorLookup.LookupText(text);       // one blob: splits on newlines, commas, semicolons, pipes, tabs
MacVendorLookup.LookupManyLazy(lines);  // streams, for files too big to buffer

Summarise a batch:

foreach (var pair in results.CountByVendor())
    Console.WriteLine($"{pair.Value,6}  {pair.Key}");

Console.WriteLine(results.Summarize());
// 4812 looked up: 4790 resolved across 11 vendor(s), 18 unknown prefix, 4 invalid

Filters: WhereFound(), WhereUnknownVendor(), WhereInvalid(), WhereValid(), GroupByVendor().

Normalising

MacVendorLookup.Normalize("4846fb112233");                                // "48:46:FB:11:22:33"
MacVendorLookup.Normalize("4846fb112233", MacAddressFormat.Hyphen);       // "48-46-FB-11-22-33"
MacVendorLookup.Normalize("4846fb112233", MacAddressFormat.Dot);          // "4846.FB11.2233"
MacVendorLookup.Normalize("4846fb112233", MacAddressFormat.None, false);  // "4846fb112233"

Formats: Colon (default), Hyphen, Dot, Space, None. Invalid input returns null. This is the right way to key a database or dictionary by MAC — it collapses every spelling onto one canonical form.

Two things worth knowing

Vendor names are the registrant's legal name, verbatim from the IEEE — Routerboard.com, not MikroTik; HUAWEI TECHNOLOGIES CO.,LTD, not Huawei. Match on a fragment (Contains("huawei", StringComparison.OrdinalIgnoreCase)) rather than the exact string.

Pass the full address when you have it, not just the OUI. The IEEE splits some blocks between several companies, and only the full address identifies which one:

MacVendorLookup.GetVendorName("8C:1F:64");            // "IEEE Registration Authority"
MacVendorLookup.GetVendorName("8C:1F:64:AF:A0:01");   // "DATA ELECTRONIC DEVICES, INC"

Also check MacAddress.Parse(mac).IsLocallyAdministered if it matters: randomised phone addresses and operator-assigned ones carry no vendor meaning, whatever the registry says about that block.

Performance

A lookup takes ~115 ns and allocates nothing. The registry unpacks itself on first use (~16 ms, ~2.1 MiB); call OuiRegistry.Preload() at start-up if you would rather not pay that on a request. Everything is thread-safe — share it across a request pipeline without locking.

Details in docs/performance.md.

More

  • OuiRegistry — query the data directly, search by vendor name, read DataVersion
  • MacAddress — parse without the registry; octets, multicast/broadcast/local bits, comparison
  • docs/data-format.md — how the embedded registry is built and refreshed
  • CONTRIBUTING.md — including why vendor-data fixes go to the IEEE, not here

License

MIT — see LICENSE. Registry data is published by the IEEE Registration Authority and redistributed here as a compiled lookup table.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 is compatible.  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.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 149 8/24/2026