Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Developer tools

Random MAC address generator

A random MAC address generator makes six random bytes and then sets two bits of the first one, so the address is marked as locally administered, universal or multicast. One result looks like 3A:7F:00:C4:91:D8, and you can make up to 200 at once.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

0 to 5 octets, kept as typed. The rest is random.
Address type
Format
Letters
Random MAC addresses
3A:7F:00:C4:91:D8 9E:12:B5:60:0D:F3 C2:44:8A:19:E7:5B 56:A0:31:CC:2F:84 FA:6D:07:93:BA:1E
  • 5 addresses, all different
First address
3A:7F:00:C4:91:D8
Its type
locally administered, unicast
First octet in binary
00111010

How to use the Random MAC Address Generator

  1. Type How many addresses you want, from 1 to 200. Each one in a batch is different.
  2. Pick an Address type. Locally administered unicast is the usual choice for test machines and virtual devices.
  3. Choose the Format and the letter case. Add a Fixed start such as 02:11:22 if the addresses must share a prefix.
  4. Press Copy all, or Generate again for a new set. The first address is explained in the facts under the list.

How is a random MAC address built?

A MAC address has 48 bits, written as six octets of two hex digits. The generator takes six bytes from the browser's cryptographic random source and then edits the first byte. RFC 9542, which replaced RFC 7042, names the two lowest bits of that byte: the Group bit (value 01) is 0 for unicast and 1 for multicast, and the Local bit (value 02) is 0 for a globally unique identifier and 1 for one controlled by a local administrator.

Say the random first byte is B7, which is 10110111 in binary. For a locally administered unicast address the generator clears the lowest bit and sets the second one, giving 10110110, which is B6. For a universal unicast address it clears both and gets B4. For multicast it sets both and gets B7. Only the last two bits change, so the other 46 bits stay random.

If you type a fixed start, those octets are used exactly as written and nothing is forced, so the type options are ignored. The facts panel then reads the two bits from your prefix and tells you what you ended up with.

The same random first byte B7 after each address type is applied
Address typeFirst octet in binaryHex
Locally administered, unicast10110110B6
Universal, unicast10110100B4
Locally administered, multicast10110111B7

Which address type should I generate?

Locally administered unicast is the safe default. The Local bit says the address was not handed out by a manufacturer, so it will not pretend to belong to a real vendor, and the cleared Group bit means a single device can own it. That fits virtual machines, containers, lab networks and test data.

Universal unicast leaves the Local bit at 0, which is the pattern of a manufacturer assigned address. Here the other bits are random, so the first three octets may happen to match a real vendor prefix by chance. Use it only for mock data that needs the universal look. Multicast sets the Group bit and is meant to address a group of devices, so it should not be given to one network card.

This page only writes text. It does not change the address of any device, and the numbers are not checked against any registry.

Can two random MAC addresses match?

With the two type bits fixed, 46 bits remain random, which is 70,368,744,177,664 different addresses. The chance that a batch of n has a repeat is about 1 minus e to the power of negative n(n minus 1) divided by twice that number. The table shows it for batches of different sizes. Within one batch the page also throws away any repeat and draws again, so the list you copy never has two equal rows.

The risk appears when you generate addresses at different times and put them on the same network. For a lab with a few dozen machines the odds are tiny, as the table shows. For millions of addresses a collision becomes likely, and an assigned scheme with a fixed prefix and a counter is the better design.

Formats are only different spellings of the same 48 bits: colons, hyphens, three dotted groups of four digits, or no separator at all. Upper or lower case does not matter to the value. For other test data, see the UUID generator or the random PIN generator.

Chance of at least one repeat in a batch, with 46 random bits
Addresses generatedChance of a repeat
101 in 1,600,000,000,000
1,0001 in 140,000,000
100,0001 in 14,000
1,000,0001 in 140
10,000,00050.9%

Use it with

Questions

What is a MAC address?

It is a 48 bit identifier written as six pairs of hex digits, such as 3A:7F:00:C4:91:D8. RFC 9542 describes the 48 bit form as an EUI-48 with a 3 octet organizational part and 3 more octets.

What do the first octet bits mean?

The lowest bit, the Group bit, is 0 for unicast and 1 for multicast. The next bit, the Local bit, is 0 for a globally unique address and 1 for a locally administered one.

Why is the second hex digit of its first octet 2, 6, A or E?

With the Local bit set and the Group bit clear, the last two bits of the first octet are 10. The four bits of the second hex digit can then only be 0010, 0110, 1010 or 1110, which are 2, 6, A and E.

Will this change my own MAC address?

No. The page makes text only and never touches your network settings.

Are the addresses random enough?

The bytes come from the browser's cryptographic random generator, and nothing is saved or sent anywhere.

Can I pick the first bytes myself?

Yes. Type 0 to 5 octets in Fixed start, with colons, hyphens, dots or none, and the generator fills in the rest.

The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.