PHPackages                             ocolin/maclookup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ocolin/maclookup

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ocolin/maclookup
================

MAC address vendor lookup with file, memory, and database drivers

v4.0.3(1mo ago)24.1k↓90.5%MITPHPPHP ^8.2

Since Aug 21Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ocolin/MacLookup)[ Packagist](https://packagist.org/packages/ocolin/maclookup)[ Docs](https://github.com/ocolin/MacLookup)[ RSS](/packages/ocolin-maclookup/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (4)Versions (25)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/2d6e8a279b59e9b9bd89de374d57c043a84a70642ecdcd8e0e091c9ae4a3c19f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f636f6c696e2f6d61636c6f6f6b7570)](https://camo.githubusercontent.com/2d6e8a279b59e9b9bd89de374d57c043a84a70642ecdcd8e0e091c9ae4a3c19f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f636f6c696e2f6d61636c6f6f6b7570)[![PHP Version](https://camo.githubusercontent.com/438d97311f01287e7e72bcecdb48fb0f5f84c9055753038f0dcad8d1e77675df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6f636f6c696e2f6d61636c6f6f6b75702f706870)](https://camo.githubusercontent.com/438d97311f01287e7e72bcecdb48fb0f5f84c9055753038f0dcad8d1e77675df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6f636f6c696e2f6d61636c6f6f6b75702f706870)[![License](https://camo.githubusercontent.com/63394cfd4f20888b6f616630ffee8b611f4ace30097d689cfcc7096ba51ff258/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f636f6c696e2f6d61636c6f6f6b7570)](https://camo.githubusercontent.com/63394cfd4f20888b6f616630ffee8b611f4ace30097d689cfcc7096ba51ff258/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f636f6c696e2f6d61636c6f6f6b7570)[![Downloads](https://camo.githubusercontent.com/cf103681f9c07950bd20c3e60f8255121ac7f52e4fad35894de1cf4903ebd357/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f636f6c696e2f6d61636c6f6f6b7570)](https://camo.githubusercontent.com/cf103681f9c07950bd20c3e60f8255121ac7f52e4fad35894de1cf4903ebd357/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f636f6c696e2f6d61636c6f6f6b7570)

MacLookup
=========

[](#maclookup)

Table of Contents
-----------------

[](#table-of-contents)

- [What is it?](#What-is-it)
- [How does it work?](#How-does-it-work)
- [Note from Author](#Note-from-Author)
- [Installation](#Installation)
- [Instantiation](#Instantiation)
    - [Arguments](#Arguments)
    - [File Driver](#File-Driver)
    - [Memory Driver](#Memory-Driver)
    - [Database Driver](#Database-Driver)
- [Lookups](#Lookups)
    - [Lookup](#Lookup)
    - [BulkLookup](#BulkLookup)
- [Special cases](#Special-cases)
    - [Invalid MAC](#Invalid-MAC)
    - [Private MAC](#Private-MAC)
    - [Not Found](#Not-Found)
- [Formatting](#Formatting)
- [Updating](#Updating)
- [Benchmarks](#Benchmarks)

---

What is it?
-----------

[](#what-is-it)

This is a small tool for looking up MAC vendor information of a give MAC address or group of MAC addresses.

---

How does it work?
-----------------

[](#how-does-it-work)

Upon first instantiation it downloads the library of MAC vendors from IEEE from which it can then do local lookups directly rather than connecting to an external server.

---

Note from Author
----------------

[](#note-from-author)

This version is not compatible with previous versions. The reason for this is that the previous versions were part of testing and it was not expected that they would get used by anyone. Apologies for the incompatibility but they were done in a hurry and not written for a userbase. Any further versions will be done so in a more compatible way.

---

Requirements
------------

[](#requirements)

- PHP ^8.2
- SQLite extension (for some functions)

---

Installation
------------

[](#installation)

```
composer require ocolin/mac-lookup

```

---

Instantiation
-------------

[](#instantiation)

MacLookup has 3 static functions for instantiation depending on the intended use. Keep in mind that upon first use, this plugin will download the IEEE database which may take a few seconds. Once downloaded it will read from the local copy.

### Arguments

[](#arguments)

Each instantiation can take two optional arguments. It was designed to not be used with these options, but they exist for special circumstances.

NameTypeDefaultDescriptiondataPathstringSystem temp files dir or project dirAllows you so specify a folder to store the Vendor dataautoUpdatebooleantrueIf the vendor data is not found on instantiation, aotumatically download new data### File Driver

[](#file-driver)

This instantiation stores the data in a local file and does lookups by parsing through that file. This is the slowest method, but also the most memory efficient. Use this method if saving memory is your biggest concern.

#### Basic Example

[](#basic-example)

```
$maclookup = Ocolin\MacLookup::file();
```

#### Advanced Example

[](#advanced-example)

```
$maclookup = Ocolin\MacLookup::file( dataPath: __DIR__ . '/files', autoUpdate: false );
```

### Memory Driver

[](#memory-driver)

This instantiation stores all the vendor data in memory. This driver is the fastest, but uses the most memory. Use this version if you don't care about memory usage.

#### Basic Example

[](#basic-example-1)

```
$maclookup = Ocolin\MacLookup::memory();
```

#### Advanced Example

[](#advanced-example-1)

```
$maclookup = Ocolin\MacLookup::memory( dataPath: __DIR__ . '/files', autoUpdate: false );
```

### Database Driver

[](#database-driver)

This instantiation stores the vendor data in an SQLite database. It's a compromise between two methods. It gives you the low memory usage of the file driver, and close to the same speed as the memory driver. However, it requires that you have the SQLite extension installed in PHP.

#### Basic Example

[](#basic-example-2)

```
$maclookup = Ocolin\MacLookup::database();
```

#### Advanced Example

[](#advanced-example-2)

```
$maclookup = Ocolin\MacLookup::database( dataPath: __DIR__ . '/files', autoUpdate: false );
```

---

Lookups
-------

[](#lookups)

There are two methods of looking up mac addresses. One for looking up an individual mac addres, and another for doing bulk lookups.

### Lookup

[](#lookup)

This function allows you to look up a single mac address.

#### Example:

[](#example)

```
$vendor = $maclookup->lookup( mac: '54:91:AF:B2:02:3A' );
print_r( $vendor );

/*
Ocolin\MacLookup\Vendor Object
(
    [mac] => 54:91:AF:B2:02:3A
    [registry] => MA-M
    [assignment] => 5491AFB
    [name] => Hyperconn Pte. ltd
    [address] => 128 Tanjong Pagar Road Singapore(088535) Singapore  SG 088535
)
*/
```

### BulkLookup

[](#bulklookup)

This method allows you to look up an array of MAC addresses. When searching for multiple addresses you can send them in a single request rather than make repeated single requests. This speeds up lookups when you know you have multiple lookups to make.

The output is an array using the MAC address as an array index so you can lookup a particular MAC address by array index name.

#### Example:

[](#example-1)

```
$vendors = $maclookup->bulkLookup( macs: [ '54:91:AF:B2:02:3A', '[B8:27:EB:00:00:01' ] );
print_r( $vendors )

/*
Array
(
    [54:91:AF:B2:02:3A] => Ocolin\MacLookup\Vendor Object
        (
            [mac] => 54:91:AF:B2:02:3A
            [registry] => MA-M
            [assignment] => 5491AFB
            [name] => Hyperconn Pte. ltd
            [address] => 128 Tanjong Pagar Road Singapore(088535) Singapore  SG 088535
        )

    [B8:27:EB:00:00:01] => Ocolin\MacLookup\Vendor Object
        (
            [mac] => B8:27:EB:00:00:01
            [registry] => MA-L
            [assignment] => B827EB
            [name] => Raspberry Pi Foundation
            [address] => Mitchell Wood House Caldecote Cambridgeshire US CB23 7NU
        )
)
*/
```

---

Special cases
-------------

[](#special-cases)

Sometimes as MAC address may be invalid, private, or not found in the IEEE database. In these cases the registry value of the returned vendor object will inform you of the status if not something in an IEEE registry.

### Invalid MAC

[](#invalid-mac)

MacLookup will detect any invalid mac addresses and return an invalid address to save time from a long lookup.

```
Ocolin\MacLookup\Vendor Object
(
    [mac] => ZZ:91:AF:B2:02:3A
    [registry] => Invalid
    [assignment] =>
    [name] =>
    [address] =>
)
```

### Private MAC

[](#private-mac)

MAC addresses in the reserved private space will also be spared a long lookup and returned indicating they are private.

```
Ocolin\MacLookup\Vendor Object
(
    [mac] => 52:91:AF:B2:02:00
    [registry] => Private
    [assignment] =>
    [name] =>
    [address] =>
)
```

### Not Found

[](#not-found)

Some MAC addresses are valid, public, but not registered with IEEE. These will have a "Not Found" indication for the resigstry.

```
// Don't have a known Not Found MAC to use in example!
Ocolin\MacLookup\Vendor Object
(
    [mac] => 99:91:AF:B2:99:99
    [registry] => Not Found
    [assignment] =>
    [name] =>
    [address] =>
)
```

---

Formatting
----------

[](#formatting)

MacLookup will accept MAC addresses that are coma separated or dash separated, dot separated or raw Hex. Leader zeros for will also be automatically added if needed.

---

Updating
--------

[](#updating)

Each driver has an update function for manually updating. This is not intended to be used much, however it is available should anyone want to refresh the vendor list from IEEE. The same can also be done by deleting the existing vendor file.

```
$macLookup->update();
// Returns void. Will throw an error if update is unsuccessful.
```

---

Benchmarks
----------

[](#benchmarks)

There is a benchmark utility that can be used to compare times of lookups if needed. You can provide a MAC address for an argument and it will use all 3 drivers and compare the memory usage and speed.

```
================================
  MacLookup Benchmark Results
================================

MAC Address: 54:91:AF:B2:02:3A

FILE DRIVER
    Memory : 4 MB
    Time   : 11.0120773315 ms

MEMORY DRIVER
    Memory : 46.5 MB
    Time   : 0.3309249878 ms

DATABASE DRIVER
    Memory : 4 MB
    Time   : 0.4739761353 ms
================================

```

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance90

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Total

24

Last Release

54d ago

Major Versions

1.4 → 2.02025-09-18

2.7 → 3.02025-11-25

3.6 → v4.0.02026-04-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (4 commits)")

---

Tags

networkvendorlookupieeeMACMac Addressoui

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-maclookup/health.svg)

```
[![Health](https://phpackages.com/badges/ocolin-maclookup/health.svg)](https://phpackages.com/packages/ocolin-maclookup)
```

###  Alternatives

[clue/graph

GraPHP is the mathematical graph/network library written in PHP.

7244.5M43](/packages/clue-graph)[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3167.3M68](/packages/mlocati-ip-lib)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.6M28](/packages/s1lentium-iptools)[graphp/graph

GraPHP is the mathematical graph/network library written in PHP.

714311.7k5](/packages/graphp-graph)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

175852.6k14](/packages/markrogoyski-ipv4-subnet-calculator)[fab2s/nodalflow

A PHP Nodal WorkFlow

16373.7k1](/packages/fab2s-nodalflow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
