MAC Addresses Explained: Format, OUI, and Generating Safe Test MACs

The 48-bit MAC address explained: octet structure, OUI vendor prefixes, the U/L and I/G bits, and how to generate safe locally-administered test MACs.

By FakeName Editorial TeamPublished June 25, 2026Last updated June 26, 20269 min read

Every network frame on an Ethernet or Wi-Fi link carries a source and destination MAC address: a 48-bit number that names the interface, not the host. Developers building network tooling, QA teams seeding device inventories, and engineers writing packet tests all need to produce MAC values that look real but cannot impersonate a shipped product. This guide breaks down the format defined in IEEE 802, explains the two bits that change everything, and shows how to mint test addresses that never collide with a real vendor.

What is a MAC address and what is it used for?

A MAC address is a 48-bit identifier assigned to a network interface controller for use as a link-layer address. It is structured as six octets, usually written in hexadecimal such as 00:1A:2B:3C:4D:5E. Switches use it to forward frames; ARP maps it to IP addresses; and Wi-Fi uses it to associate stations with access points [ieee-802].

MAC stands for Media Access Control, the lower sublayer of the data link layer in the IEEE 802 reference model. The address operates at Layer 2, meaning it is only meaningful within a single broadcast domain. Routers rewrite the source and destination MAC at every hop, while the IP addresses stay constant end to end. This is why a captured MAC tells you about the adapter on the local segment, not the original sender across the internet.

What is the MAC address format and octet structure?

A MAC address is six octets totaling 48 bits, split into two halves. The first three octets (24 bits) form the OUI, identifying the manufacturer. The last three octets (24 bits) form the device-specific portion assigned by that manufacturer. The full 48-bit space holds roughly 281 trillion (2^48) addresses; because the I/G and U/L bits in the first octet are reserved, about 70 trillion (2^46) of those are available as globally-unique unicast addresses [ieee-tut].

OctetExample valueBitsRole
1000-7OUI byte 1 (contains I/G and U/L bits)
21A8-15OUI byte 2
32B16-23OUI byte 3 (completes the 24-bit vendor prefix)
43C24-31Device byte 1 (vendor-assigned)
54D32-39Device byte 2 (vendor-assigned)
65E40-47Device byte 3 (vendor-assigned)
The six-octet structure of a 48-bit EUI-48 MAC address, using 00:1A:2B:3C:4D:5E as a worked example.

Notation varies by platform. Linux and most documentation use colon-separated lowercase (00:1a:2b:3c:4d:5e); Windows uses hyphens (00-1A-2B-3C-4D-5E); Cisco devices use dot-separated triplets (001a.2b3c.4d5e). All three encode the identical 48 bits. When parsing user input, accept all separators and normalize before comparison.

What is the OUI and how does OUI lookup work?

The OUI (Organizationally Unique Identifier) is the first 24 bits of a MAC, assigned to an organization by the IEEE Registration Authority. OUI lookup resolves that prefix to the registered company by querying the public IEEE registry, distributed as a downloadable CSV of every assignment [ieee-oui-listing]. Large vendors register many blocks, while small-block holders share a prefix range [ieee-ra].

The IEEE actually sells three registry sizes. The classic MA-L (large) block grants a full 24-bit OUI and 16.7 million device addresses. Smaller assignments, MA-M and MA-S, hand out more OUI bits to the IEEE and fewer device bits to the buyer, which is why a 24-bit prefix alone no longer guarantees a single owner.

Block typeBits assigned to orgUnique addressesTypical buyer
MA-L (large)24 (full OUI)16,777,216High-volume hardware vendors
MA-M (medium)281,048,576Mid-size manufacturers
MA-S (small)364,096Low-volume or specialty devices
IEEE Registration Authority assignment block sizes and the address space each grants to the registrant.
An OUI is a 24-bit globally unique assigned number referenced by various standards. OUI is used in the family of 802 LAN standards, e.g. Ethernet, and is encoded into MAC addresses.
IEEE Registration Authority, Guidelines for Use of EUI, OUI, and CID (2017)

What do the U/L and I/G bits in a MAC address mean?

Two flag bits live in the least-significant positions of the first octet. The I/G (Individual/Group) bit is bit 0: 0 means a unicast address for one interface, 1 means a multicast or broadcast group. The U/L (Universal/Local) bit is bit 1: 0 means a globally-administered IEEE-assigned address, 1 means a locally-administered address set by software or an admin [ieee-802].

These bits are read in transmission order, where the least-significant bit of each octet goes on the wire first. In the human-readable hexadecimal of the first octet, that places I/G as the rightmost bit and U/L as the second-from-right bit. The broadcast address FF:FF:FF:FF:FF:FF has both bits set because it is a group address that is also locally meaningful.

First-octet low bitsU/L bit (bit 1)I/G bit (bit 0)Meaning
xxxxxx000 = global0 = unicastVendor-assigned unicast (a real shipped NIC)
xxxxxx010 = global1 = multicastGlobally-scoped multicast group
xxxxxx101 = local0 = unicastLocally-administered unicast (SAFE for test data)
xxxxxx111 = local1 = multicastLocally-administered multicast
The two control bits in the first octet of a MAC address and the values of the low nibble that result.

How do you generate a safe random MAC address for testing?

To generate a safe test MAC, produce six random octets, then force the first octet so its U/L bit is 1 and its I/G bit is 0. In practice: take the random first octet, clear bit 0, set bit 1 (the operation byte0 = (byte0 AND 0xFC) OR 0x02). The result is a locally-administered unicast address that the IEEE will never assign to a vendor, so it is collision-safe against real hardware [ietf-rfc7042].

  1. Generate 6 random bytes from a cryptographic or seeded source.
  2. Take the first byte and apply byte0 = (byte0 & 0xFC) | 0x02 to set U/L=1 and I/G=0.
  3. Keep the remaining 5 bytes as-is for the device portion.
  4. Format the six octets with your target separator (colon, hyphen, or Cisco dot).
  5. Track issued values per network so two test devices on the same link never repeat.
StepFirst octet (binary)First octet (hex)Status
Raw random byte10101101ADUnknown scope, could resemble a vendor
After & 0xFC10101100ACI/G cleared (unicast)
After | 0x0210101110AEU/L set (locally administered, safe)
Final example MACAE:7F:11:90:C3:42Locally-administered unicast test MAC
How the first octet transforms when you apply the locally-administered mask, with the resulting safe address.

The four low nibble values that signal a locally-administered second hex digit in the first octet are 2, 6, A, and E (binary x010, x110, x1010, x1110). If your generated address starts with any of those in the second position and ends the octet on an even number, it is in the locally-administered unicast range. Our generator at / emits MACs that already carry the U/L bit, so the output is safe to drop into device fixtures, DHCP test pools, or network simulation without auditing each value by hand.

Where do real devices use locally-administered MACs?

MAC randomization is now the default privacy behavior on consumer devices. Apple shipped private Wi-Fi addresses in iOS 14 (released September 2020), Android 10 enabled randomized MACs per network by default (2019), and Windows 10 added the option in 2015. Every one of these features sets the locally-administered bit, which is the same range you should target for test data so your fixtures match production traffic patterns [ietf-rfc7042].

How do MAC addresses relate to other identifiers in test data?

A MAC names the Layer 2 interface; an IP address names the Layer 3 host; a User-Agent string names the client software. A realistic device fixture often needs all three together. When you build network test scenarios, pair a locally-administered MAC with a reserved test IP range and a synthetic browser identifier so the whole record stays clearly fictional end to end.

Keeping each identifier inside its documented test range is the single rule that keeps a dataset safe. Reserved IP blocks, locally-administered MAC space, and clearly-fictional names all share the property that they cannot collide with a real production asset, which is what makes them appropriate for repeatable QA. When auditors later inspect captured test traffic, a MAC with the U/L bit set signals at a glance that the frame originated from a synthetic device rather than physical hardware, which keeps test artifacts separable from production logs.

One caution for IPv6 work: the EUI-64 derivation used in stateless address autoconfiguration historically inverted the U/L bit when expanding a 48-bit MAC into a 64-bit interface identifier. A locally-administered source MAC therefore maps to a different interface ID than a globally-administered one, so verify the inversion rule in RFC 7042 when you build IPv6 fixtures from generated MAC values [ietf-rfc7042]. For most Layer 2 testing the 48-bit address alone is all you need.

References & sources

  1. IEEE Std 802-2014: Overview and Architecture (LAN/MAN reference model, MAC addressing)IEEE Standards Association
  2. IEEE Registration Authority: Standards-related products and OUI/MA-L registryIEEE Registration Authority
  3. Guidelines for Use of Extended Unique Identifier (EUI), Organizationally Unique Identifier (OUI), and Company ID (CID)IEEE Registration Authority
  4. RFC 7042: IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 ParametersIETF
  5. IEEE Public OUI/MA-L Assignment Listing (oui.csv)IEEE Registration Authority
  6. RFC 5737: IPv4 Address Blocks Reserved for DocumentationIETF

Frequently asked questions

What is a MAC address in simple terms?+

A MAC address is a 48-bit hardware identifier burned into or assigned to a network interface. It labels the interface on the local link layer so frames reach the correct device. Written as six hex octets like 00:1A:2B:3C:4D:5E, the first three identify the vendor and the last three identify the specific adapter.

How do I make a random MAC address that won't collide with a real device?+

Generate six random octets, then force the second-least-significant bit of the first octet to 1 (the locally-administered bit) and the least-significant bit to 0 (unicast). This places the address in the locally-administered range, which the IEEE never assigns to any manufacturer, so it cannot match a shipped adapter.

What is an OUI and how does OUI lookup work?+

An OUI (Organizationally Unique Identifier) is the first 24 bits of a MAC address, assigned to a company by the IEEE Registration Authority. OUI lookup maps that prefix back to the registered organization using the public IEEE registry, letting you identify the likely vendor of a network adapter from its MAC.

Which bit makes a MAC address locally administered?+

The second-least-significant bit of the first octet is the U/L (Universal/Local) bit. When it is 0, the address is globally administered by an IEEE OUI assignment. When it is 1, the address is locally administered, meaning it was set by an admin or software and is safe for test data.

Why do phones and laptops use random MAC addresses now?+

Modern devices randomize MAC addresses during Wi-Fi probing and association to prevent tracking across networks. These randomized addresses set the locally-administered bit so they stay outside vendor-assigned space. The practice became default in iOS 14, Android 10, and Windows 10 to improve privacy on public networks.

Can a locally-administered MAC address still cause a conflict?+

Two devices on the same broadcast domain must not share a MAC, so collisions are still possible within one network if you reuse a value. Using the locally-administered bit only guarantees you will not clash with a globally-assigned vendor address; you still pick unique values per device on a given link.

We use cookies for analytics and ads to keep this generator free. See our Privacy Policy.