Skip to main content

a random 12-digit mac address generator

Project description

a utility that generates 12-digit mac addresses; either the NIC portion or full 12-digit MAC.

the optional -f argument will return a random 12-digit MAC address that can be identified by the locally administrated address (LAA) format. This means you will always see x2, x6, xA, or xE at the beginning of a MAC address generated by randmac.


to install with pip:

pip install randmac


Python >3.2 required.

mac address formats

Supported MAC address formats:


where M stands for the manufacturer or vendor, and S stands for the NIC specific portion.


requires a mac address as input. it is used to determine what the output format should be.

you can from randmac import RandMac and use it like RandMac("00:00:00:00:00:00").

from a terminal (if the is in your path and executable) you can use $ python3 00:00:00:00:00:00 to get a generate a new NIC portion, or $ python3 00:00:00:00:00:00 -f to generate a new 12-digit LAA MAC.

example usage

>>> from randmac import RandMac
>>> RandMac("00:00:00:00:00:00")
>>> RandMac("00:00:00:00:00:00", True)
>>> RandMac("0000.0000.0000", True)


$ python3 00:00:00:00:00:00
$ python3 00:00:00:00:00:00 -f


license can be found here.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for randmac, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size randmac-0.0.2-py2.py3-none-any.whl (5.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size randmac-0.0.2.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page