randmac
a random 12-digit mac address generator
What it is and what it does
randmac is a lightweight utility for generating random MAC addresses in multiple formats. It can produce either full 12-digit addresses or preserve the manufacturer (OUI) portion while randomizing the NIC-specific portion. The package supports five common MAC address formats: colon-separated (MM:MM:MM:SS:SS:SS), hyphen-separated (MM-MM-MM-SS-SS-SS), dot-separated (MM.MM.MM.SS.SS.SS), Cisco format (MMMM.MMSS.SSSS), and unformatted (MMMMMMSSSSSS).
The main use case is generating test or mock MAC addresses for network testing, device simulation, or security research. It includes a command-line interface for quick generation and a Python API for programmatic use. The optional LAA (locally administrated address) mode ensures generated addresses are marked as locally administered by constraining the first hex digit to x2, x6, xA, or xE, which is useful when you need addresses that won't collide with real hardware vendors.
Use it for:
- Generate mock MAC addresses for network testing and device simulation scenarios
- Create test data for network monitoring or DHCP server testing
- Randomize NIC portions while preserving a specific OUI for vendor-specific testing
- Generate LAA-compliant addresses for local network administration and testing
- Quick command-line MAC address generation without writing code
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates random 12-digit MAC addresses in multiple formats, with optional support for locally administrated address (LAA) format compliance.
Yes, if you need a simple, dependency-free MAC address generator for testing or development. The low install friction and permissive license make it a low-risk addition. However, the abandoned maintenance status and Alpha classification mean it's best suited for non-critical tooling; do not rely on it for production systems. Verify LAA format correctness for your specific use case before deploying.
Install
randmac on PyPI
pip
pip install randmacuv
uv add randmacpoetry
poetry add randmacInstalling randmac
Before you install
Low install friction with no runtime dependencies. Package is abandoned (last release 2020-09-13, last commit 2023-05-25) and classified as Alpha, so expect no active maintenance or bug fixes.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions.
Quickstart
from randmac import RandMac
# Generate a random LAA-format MAC address
mac = RandMac()
print(mac) # e.g., 'a6:9b:6b:8e:b3:42'
# Generate with custom format
mac_custom = RandMac("00:00:00:00:00:00", True)
print(mac_custom) # e.g., '00:00:00:3f:8a:06'
Requires Python >3.2
Verify before relying
- Whether the package works reliably with Python versions beyond 3.2 despite the classifier listing only 3.2
- Whether the LAA format generation (x2, x6, xA, xE prefix guarantee) is consistently correct across all output formats
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>3.2,) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,161 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 78,104/month — #14,469 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: randmac-0.1-py2.py3-none-any.whl
Keywords: randmac, random mac, random mac address
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
macaddressParses, validates, and converts MAC addresses…
permissive · top 15,000 on PyPI
random-addressGenerates random real US addresses with…
permissive · top 15,000 on PyPI
mac-vendor-lookupResolves MAC addresses to vendor names using a…
permissive · top 15,000 on PyPI
getmacRetrieves MAC addresses of local network…
permissive · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
aioouiPerforms asynchronous lookups of…
permissive · top 15,000 on PyPI
wakeonlanSends wake-on-LAN magic packets to power on…
permissive · top 15,000 on PyPI
netifaces-plusRetrieves network interface information…
permissive · top 15,000 on PyPI
usaddressusaddress parses unstructured US address…
permissive · top 5,000 on PyPI
netifacesProvides portable access to network interface…
permissive · top 5,000 on PyPI