MAC address generator

Enter the quantity and prefix.

loading MAC address generator
About this tool

What is a MAC address generator?

A MAC address generator creates random 48-bit hardware addresses such as 64:16:7F:3A:9C:E1. Developers and network engineers need them as test data: filling a device inventory, seeding a DHCP or NAC database, writing unit tests for code that parses or validates MAC addresses, simulating many virtual machines or containers, or labelling virtual interfaces in a lab.

A MAC address has a clear structure. The first byte carries two flag bits: bit 0 says whether the address is unicast (one device) or multicast (a group), and bit 1 says whether it is universally administered (assigned by a manufacturer) or locally administered (chosen by software, as virtual machines and privacy features do). The next two bytes complete the OUI, the vendor prefix registered with the IEEE, and the last three bytes identify the interface.

This tool lets you set a prefix (for example a vendor OUI like 64:16:7F), the case, the separator and the type, and generates as many addresses as you ask for. The random bytes come from your browser and nothing is sent to a server. Generated addresses are for testing: do not assign them to production hardware without checking for collisions on your network.

How to generate a MAC address

  1. Choose how many addresses you want in the quantity field.
  2. Optionally type a prefix of up to six bytes. Separators can be colons, hyphens, dots or none, and the rest of the address is filled with random bytes. A typed prefix is kept exactly as you wrote it.
  3. Choose uppercase or lowercase.
  4. Choose the separator: colon, hyphen, none or the Cisco dot style (0123.4567.89ab).
  5. Choose the type when you did not give a prefix: any, global (unicast set by a manufacturer), local (unicast, locally administered) or multicast. This shapes the first byte.
  6. Press refresh for a new set, then copy the result.

Examples

A random global unicast address

With type global and no prefix the result is a unicast, universally administered address. Because the two low bits of the first byte are 0, the first byte is always even and its second-lowest bit is clear, for example 3c:5a:b4:….

A virtual machine range

Prefix 52:54:00 is the one QEMU/KVM guests use by default, and it is locally administered (0x52 = 01010010). A generated value looks like 52:54:00:7e:12:9a: the prefix is kept and the last three bytes are random.

A vendor prefix

Prefix 64:16:7F with Cisco-style separators gives something like 6416.7f3a.9ce1. The first three bytes are your prefix, the rest random.

A multicast address

Type multicast sets bit 0 of the first byte, for example 01:5e:…. Note that IPv4 multicast MACs start with 01:00:5e, but a random multicast MAC is only a group-bit address and not a valid mapped multicast group.

Bulk test data

Ask for 50 addresses in uppercase with hyphens to get lines like 3C-5A-B4-11-22-33 ready to paste in a CSV.

Common mistakes

  • A prefix with invalid characters. Only 0-9 and A-F are allowed; the tool says so and highlights the field.
  • Bytes with more than two digits such as 641:67F. Each byte is two hex digits (64:16:7F).
  • A prefix longer than 6 bytes. A MAC address has exactly 6 bytes.
  • Using the type option with a typed prefix. The type only shapes the first byte when no prefix is given; a typed prefix is kept as it is.
  • Using a random address as a real device identity. Collisions are unlikely but possible, and local addresses are meant for that purpose only.
  • Using a vendor OUI of a company that is not yours in production, which can confuse inventory systems; use a locally administered address instead.

Frequently asked questions

Is a randomly generated MAC address valid?

Yes, any 48-bit value is a syntactically valid MAC. Whether it collides with a real device is another matter, which is why local addresses are the safe choice for virtual interfaces.

What is the difference between a global and a local MAC address?

Global addresses are assigned by manufacturers and have bit 1 of the first byte cleared. Local addresses set that bit and are chosen by software or administrators.

Which separator is right?

Colons are the common Unix and Linux style, hyphens the Windows style (IEEE 802 hexadecimal), dots the Cisco style, and none is used in many databases.

How do I know who made a given MAC?

Use the MAC address lookup, which reads the vendor prefix.

Can I generate other network identifiers?

For private IPv6 prefixes see the IPv6 ULA generator, and for subnets use the subnet calculator.

Report a problem