Random MAC Address Generator

Generate valid random MAC addresses in one click. Make locally administered addresses that never clash with real hardware, start them with your own prefix or a virtual machine prefix, and copy them in the format your system uses.

Virtual machine prefixes
Address type
Format
Sort results

70,368,744,177,664 possible addresses. The second digit is always 2, 6, A, or E.

Separate with
Generating...

What the random MAC address generator does

A MAC address is the 6-byte hardware address of a network card, such as 02:1A:2B:3C:4D:5E. This tool picks the bytes at random while setting the two bits that decide what kind of address it is, so every result is valid for the type you choose.

By default it makes locally administered unicast addresses. Those are meant to be set by software, so they never overlap with an address a manufacturer burned into real hardware.

Why use our random MAC address generator

  • ·Free. No signup, no paywall, and no limit on how often you generate.
  • ·Valid addresses. The unicast and local bits are set correctly, not left to chance.
  • ·Your own prefix. Start every address with 1 to 5 bytes you choose, or a virtual machine prefix.
  • ·Every common format. Colons, hyphens, Cisco dots, or none, in either case.
  • ·Private. Addresses are made on your device. Nothing is sent to a server.

How to generate a random MAC address

  1. 1

    Choose the address type

    Locally administered is the right choice for most uses, such as virtual machines and test data. Pick Custom prefix (OUI) to start every address with bytes you choose, or click a virtual machine prefix such as QEMU/KVM.

  2. 2

    Set how many addresses you want

    Ask for 1 to 1,000 addresses, and turn on No repeats if each one must be different.

  3. 3

    Pick the format

    Choose colons, hyphens, Cisco's dotted format, or no separators, and uppercase or lowercase letters. Changing the format updates the addresses already shown.

  4. 4

    Generate and copy the addresses

    Click Generate MAC address. A single address shows whether it is locally or universally administered. Several can be sorted, copied, or downloaded as a text file.

How the first byte of a MAC address works

The two lowest bits of the first byte decide what kind of address it is. The last bit is 0 for unicast (one device) and 1 for multicast (a group). The bit before it is 0 when a manufacturer assigned the address and 1 when it was set locally. You can read both from the second hex digit of the address.

Second digitLast two bitsKind of address
0, 4, 8, C00Universally administered unicastAssigned by a manufacturer. The first three bytes are its OUI.
2, 6, A, E10Locally administered unicastSet by software or an administrator. Safe to make up.
1, 5, 9, D01Universally administered multicastSent to a group of devices. Not a device's own address.
3, 7, B, F11Locally administered multicastSent to a group of devices. Not a device's own address.

So 02:1A:2B:3C:4D:5E is locally administered unicast, and 00:1A:2B:3C:4D:5E is universally administered unicast. The address FF:FF:FF:FF:FF:FF is the broadcast address, which reaches every device on the local network.

MAC address formats

All of these are the same address. Most software accepts any of them, but copying the format your system shows avoids surprises.

ExampleWhere you see it
02:1a:2b:3c:4d:5eLinux (ip link) and macOS (ifconfig)
02-1A-2B-3C-4D-5EWindows (ipconfig /all and getmac)
021a.2b3c.4d5eCisco switches and routers
021A2B3C4D5ESome device labels, databases, and APIs

MAC address prefixes for virtual machines

Hypervisors give virtual network cards addresses that start with their own prefix. If you set a VM's MAC address by hand, using the same prefix keeps it easy to recognize.

SoftwarePrefixKind of prefix
QEMU/KVM52:54:00Locally administered
VirtualBox08:00:27Universally administered
Xen00:16:3EUniversally administered
Hyper-V00:15:5DUniversally administered

QEMU/KVM's 52:54:00 is itself a locally administered prefix (its second digit is 2). The others are manufacturer (OUI) prefixes registered with the IEEE, so addresses made with them are universally administered.

When to use a random MAC address generator

  • ·Virtual machines and containers. Give a VM a fixed MAC address so it keeps the same IP from DHCP, or match the prefix your hypervisor expects. The quick picks fill in the QEMU/KVM, VirtualBox, Xen, and Hyper-V prefixes.
  • ·Testing software. Fill device inventories, network logs, and forms with valid addresses, and check that your code reads every format. Generate up to 1,000 at once.
  • ·Network labs. Make addresses for lab devices, emulators, and practice exercises without copying real hardware addresses.
  • ·Documentation. Use a locally administered address in guides and screenshots so the example never matches a real manufacturer's range.

How to generate a random MAC address in Python and JavaScript

Both snippets pick six random bytes, then clear the multicast bit and set the local bit in the first byte. In binary, 252 is 11111100 and 2 is 00000010.

Locally administered unicastPython
import random

mac = [random.randint(0, 255) for _ in range(6)]
mac[0] = (mac[0] & 252) | 2
":".join(f"{b:02x}" for b in mac)
Locally administered unicastJavaScript
const bytes = crypto.getRandomValues(new Uint8Array(6));
bytes[0] = (bytes[0] & 252) | 2;
[...bytes].map((b) => b.toString(16).padStart(2, "0")).join(":");

Random MAC address generator questions

How do I generate a random MAC address?
A random locally administered MAC address appears when the page loads. Click Generate MAC address for a new one. Set How many to get a list, and pick the format you need.
What is a locally administered MAC address?
It is an address set by software or a network administrator instead of the manufacturer. The second bit of the first byte is 1, which means the second hex digit is 2, 6, A, or E, as in 02:1A:2B:3C:4D:5E. These addresses never clash with a manufacturer's range.
Why is the second digit always 2, 6, A, or E?
Those are the four hex digits whose last two bits are 1 and 0. The 1 marks the address as locally administered, and the 0 marks it as unicast, meaning it belongs to one device. The table on this page shows all four combinations.
Can I use a random MAC address on my own device?
Yes, as long as it is a locally administered unicast address. iPhones, Android phones, and Windows already use random addresses like these on Wi-Fi for privacy. On a network with MAC filtering or DHCP reservations, a new address may lose access or get a different IP.
What is an OUI?
An OUI (Organizationally Unique Identifier) is the first three bytes of a manufacturer's MAC address, assigned by the IEEE. In 00:1A:2B:3C:4D:5E, the OUI is 00:1A:2B. Use Custom prefix (OUI) to start every address with a prefix you choose.
Why not use universally administered addresses?
A random universally administered address can land in a real manufacturer's range, so it may look like hardware it is not, or clash with a real device. Use it only when software insists on that kind of address. Otherwise choose Locally administered.
What MAC address prefix do virtual machines use?
QEMU/KVM uses 52:54:00, VirtualBox uses 08:00:27, Xen uses 00:16:3E, and Hyper-V uses 00:15:5D. Click one of the virtual machine prefixes above the options to fill it in.
Which MAC address format should I use?
Use whatever the software you paste into expects. Linux and macOS show lowercase with colons, Windows shows uppercase with hyphens, and Cisco devices use three groups of four digits separated by dots. Most tools accept colons.
Are the addresses really random?
Yes. Every pick uses your browser's secure random number generator, crypto.getRandomValues(), and every address the settings allow is equally likely. Locally administered gives 70,368,744,177,664 possible addresses, so repeats are very unlikely even without No repeats.
Is the random MAC address generator free?
Yes. It is free with no signup, and it runs in your browser, so nothing is sent to a server. Results are not saved after you leave the page, so copy or download them first.