Random MAC Address Generator

Generates random 48-bit MAC addresses locally in your browser, formatted with either colon or hyphen separators, with an option to correctly set the locally-administered and unicast bits so the result is always usable as a valid virtual-NIC address. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool generates random MAC (Media Access Control) addresses — the 48-bit hardware identifiers network interfaces use at the link layer — entirely in your browser.

It supports both common textual separators and an option to force the address into the valid locally-administered, unicast range that virtual machines and containers commonly use.

What Is Random MAC Address Generator?

A client-side generator producing 6 random bytes formatted as a colon- or hyphen-separated hex string, matching the two textual conventions most operating systems and tools display MAC addresses in.

With the locally-administered option enabled, the generator manipulates the first byte's low two bits per IEEE 802 conventions so the result is guaranteed unicast and marked as locally assigned rather than vendor-assigned.

How Random MAC Address Generator Works

Six random bytes are drawn with Math.random() (this isn't a security-sensitive value, so no cryptographic randomness is needed).

If locally-administered mode is on, the first byte is masked to clear its two low bits, then bit 1 (0x02) is set — marking it locally administered — while bit 0 (0x01) stays clear, marking it unicast.

The six bytes are hex-encoded and joined with the chosen separator to produce the final address string.

When To Use Random MAC Address Generator

Use this when you need placeholder MAC addresses for network documentation, virtualization configs, or test fixtures.

Enable the locally-administered option specifically when the address needs to be assignable to a real virtual NIC without colliding with IEEE-assigned vendor ranges.

Features

Advantages

  • Runs entirely client-side with no network calls.
  • Correctly sets the locally-administered and unicast bits on request, rather than leaving them to chance.
  • Supports both colon and hyphen separator conventions in one tool.

Limitations

  • Without the locally-administered option, the generated first byte is fully random and may occasionally land in a real IEEE-assigned OUI block or set the multicast bit — don't rely on unconstrained output for anything that must be a valid unicast NIC address.
  • Generated addresses are not checked against any real device registry.

Examples

A colon-separated MAC

Input

(no input; generated from settings)

Output

3a:5f:9c:12:e4:07

Standard Linux/networking-tool display format.

A locally-administered, hyphenated MAC

Input

(no input; generated from settings)

Output

02-1B-77-4A-9D-6E

First byte's low nibble (02) shows the U/L bit set and I/G bit clear.

Best Practices & Notes

Best Practices

  • Always enable locally-administered mode when the address will be assigned to a real virtual interface.
  • Use colon separators for Unix/Linux-facing documentation and hyphens for Windows-facing documentation to match reader expectations.
  • Generate a batch if you need several distinct interfaces documented at once.

Developer Notes

The locally-administered transform masks the first byte with 0xfc before OR-ing in 0x02, which clears both the U/L and I/G bits before setting U/L — this avoids a subtle bug where a randomly-set I/G bit from the raw byte would survive the OR and mark the address as multicast.

Random MAC Address Generator Use Cases

  • Documenting a virtual machine or container network interface
  • Populating a network-inventory test fixture
  • Writing a tutorial on MAC address structure

Common Mistakes

  • Using an address generated without locally-administered mode as a real virtual NIC's MAC, risking an accidental multicast bit or collision with a real vendor OUI.
  • Mixing colon- and hyphen-formatted addresses inconsistently within the same document.

Tips

  • The first hex pair's low nibble tells you the U/L and I/G bits at a glance: an even low nibble is unicast, and 2/6/A/E indicates locally administered.
  • Pair this with the Random IP Address Generator when building a full fake network-interface record.

References

Frequently Asked Questions