MAC Address Generator

JJ Ben-Joseph headshot JJ Ben-Joseph

How This MAC Address Generator Helps

This MAC Address Generator creates random, correctly formatted Media Access Control (MAC) addresses for lab work, documentation, and testing. You can optionally supply a prefix (OUI or partial address), and the tool will preserve what you enter while randomizing the remaining octets.

All generation happens in your browser only. No prefixes, generated addresses, or results are sent to a server or stored on the site.

How MAC Addresses Are Structured

A MAC address uniquely identifies a network interface at the data link layer (Layer 2). The most common format is 48 bits, split into six octets, usually written as hexadecimal pairs separated by colons or hyphens, for example:

00:1A:2B:3C:4D:5E

Each octet is 8 bits, and each hexadecimal pair represents 0 to 255 in decimal. Overall, a 48-bit MAC address provides the following number of possible values:

2 48 = 281474976710656

Traditionally, the first three octets (24 bits) form the Organizationally Unique Identifier (OUI), assigned by the IEEE to a vendor. The remaining three octets are assigned by that vendor to individual devices.

Two important bits live in the first octet:

  • Universal vs. local (U/L bit): when set to 1, the address is locally administered (not globally unique from IEEE).
  • Unicast vs. multicast (I/G bit): when set to 1, the address is intended for multicast, not a single host.

What Is an OUI Prefix?

The OUI identifies the vendor or organization that owns a block of MAC addresses. For example, a vendor might have an OUI like 00:1A:2B, meaning every device they manufacture in that block begins with those three octets.

In this tool, you can treat the prefix field as:

  • An OUI (first three octets), such as 00:1A:2B.
  • A shorter prefix, such as one or two octets, if you only care about the first byte(s).
  • A longer prefix, up to all six octets, if you want to control more of the address.

Valid Prefix Formats and Tool Behavior

The prefix field accepts hexadecimal pairs in several common styles. Internally, the generator normalizes separators and case before generating the final address.

Accepted input formats

  • With colons: AA:BB:CC, AA:BB:CC:DD, etc.
  • With hyphens: AA-BB-CC, AA-BB-CC-DD-EE, etc.
  • Continuous hex: AABBCC or up to AABBCCDDEEFF.

You can enter from 1 up to 6 hexadecimal pairs (1–12 hex characters). The generator will:

  • Preserve the octets represented by your prefix.
  • Randomize the remaining octets until the full 6-octet MAC is complete.
  • Normalize the output using a consistent separator and uppercase hex.

If you leave the prefix blank, all six octets are chosen randomly from the full MAC address space.

How to Use This MAC Address Generator

  1. Decide whether you need a prefix. If you only need a random MAC for a test device, leave the field empty. If you are simulating a particular vendor or range, enter the required prefix.
  2. Enter the prefix (optional). Use one of the accepted formats above. Examples:
    • Random vendor-like address: 00:1A:2B
    • Locally administered range, first octet only: 02
    • Mostly fixed address, last octet random: AA:BB:CC:DD:EE
  3. Click the generate button. A normalized MAC address appears in the results area. Click again whenever you need another sample.
  4. Copy the address into your lab configuration, documentation, or test script.

You can use the tool to quickly produce:

  • Completely random MAC addresses for temporary virtual machines.
  • Addresses that resemble a specific vendor OUI for training or demos.
  • Locally administered MACs for internal-only use in test networks.

Interpreting the Generated Results

The output is always a 48-bit unstructured random MAC address, possibly constrained by your prefix. The generator does not check the prefix against the real IEEE OUI database, and it does not guarantee uniqueness across runs or sessions.

For lab and documentation purposes, this is usually sufficient, as you typically control the scope of use and can avoid collisions by not reusing the same values across many devices.

Worked Example

Suppose you want a locally administered MAC address range for virtual machines. A simple approach is to choose a first octet whose binary representation sets the local bit (second least significant bit) and clears the multicast bit.

One such value is 02, whose binary form is:

0x02 = 00000010

Steps:

  1. Enter 02 in the prefix field.
  2. Click the generate button.
  3. You might see an output like 02:3F:9A:7C:11:58.

In this example, the first octet 02 is preserved exactly as entered. The last five octets are random. You can repeat the process to obtain as many different locally administered MACs as you need for a small lab.

Comparison of Common Use Cases

Use case Prefix input Result characteristics
Completely random MAC Leave prefix blank All six octets are random; suitable for quick one-off tests.
Vendor-like MAC (OUI-based) AA:BB:CC (example OUI) First three octets fixed; last three randomized, mimicking a vendor block.
Locally administered MAC range 02 or similar first octet First octet enforces local admin bit; remaining octets random.
Mostly fixed address 00:11:22:33:44 First five octets fixed; last octet random, useful for small internal pools.

Limitations and Assumptions

  • Not an IEEE registry check: The tool does not validate your prefix against the official IEEE OUI list and may generate addresses that do not correspond to real vendors.
  • No global uniqueness guarantee: Addresses are pseudo-random and may collide if you generate many values or reuse them across large environments.
  • Testing and documentation focus: Intended for lab setups, simulations, training, and documentation, not for assigning permanent addresses in large production networks.
  • Single-host scope: Generation occurs entirely in your browser. Different users or browsers are not aware of each other’s generated addresses.
  • Format only: The tool focuses on output format and simple prefix preservation. It does not apply special logic for multicast, locally administered bits, or vendor policies unless you enforce those via your chosen prefix.

When using generated MAC addresses beyond a small lab, consider defining your own controlled addressing scheme, documenting it clearly, and avoiding overlap with any real hardware already on the network.

Enter up to six hexadecimal pairs separated by colons or hyphens.

Enter a prefix or leave blank for fully random.

Embed this calculator

Copy and paste the HTML below to add the MAC Address Generator – Random MACs with Optional OUI Prefix for Ne... to your website.