MAC Address Generator
Generate random MAC addresses in colon, dash, dot, or plain hex format with unicast/multicast selection.
Back to all tools on ToolForge
Result
About MAC Address Generator
This tool generates random MAC (Media Access Control) addresses for testing, virtualization, and network configuration. It supports multiple output formats and address types including unicast/multicast and locally administered addresses.
MAC Address Structure
A MAC address is a 48-bit (6-byte) identifier represented as 12 hexadecimal digits:
MAC Address Format (48 bits / 6 bytes): ┌─────────────────────────────────────────────────────────┐ │ AA : BB : CC : DD : EE : FF │ │ │ │ │ │ │ │ │ │ └─ Octet 0 ─┘ └─ Octet 1 ─┘ ... └─ Octet 5 ─┘ │ │ │ │ First 3 bytes (AA:BB:CC) = OUI (Manufacturer ID) │ │ Last 3 bytes (DD:EE:FF) = Device serial number │ └─────────────────────────────────────────────────────────┘ First Octet Bit Structure: ┌────────────────────────────────────────────┐ │ Bit 0: Multicast flag (0=unicast, 1=multi)│ │ Bit 1: Local flag (0=global, 1=local) │ │ Bits 2-7: OUI-specific bits │ └────────────────────────────────────────────┘ Examples: 02:00:00:00:00:00 → Unicast, Locally Administered 03:00:00:00:00:00 → Multicast, Locally Administered 00:00:00:00:00:00 → Unicast, Globally Unique (OUI assigned) FF:FF:FF:FF:FF:FF → Broadcast (special address)
MAC Address Format Comparison
| Format Name | Example | Common Use |
|---|---|---|
| Colon-separated | 02:1A:3F:B4:C7:2E |
Linux, macOS, networking tools |
| Dash-separated | 02-1A-3F-B4-C7-2E |
Windows, Hyper-V |
| Dot notation (Cisco) | 021A.3FB4.C72E |
Cisco IOS, enterprise networking |
| Plain hex | 021A3FB4C72E |
Databases, config files, APIs |
Address Type Reference
| Type | First Byte | Description |
|---|---|---|
| Unicast, Local | 02, 06, 0A, 0E |
Single device, software-assigned (recommended for VMs) |
| Multicast, Local | 03, 07, 0B, 0F |
Group address, software-assigned |
| Unicast, Global | Even (00, 04, 08, etc.) | Hardware-assigned by manufacturer |
| Multicast, Global | Odd (01, 05, 09, etc.) | Protocol addresses (e.g., spanning tree) |
| Broadcast | FF:FF:FF:FF:FF:FF |
All devices on local network |
Common OUI Assignments
| OUI Prefix | Manufacturer |
|---|---|
00:00:0C |
Cisco Systems |
00:04:5A |
Apple |
00:0C:29 |
VMware |
00:15:5D |
Microsoft Hyper-V |
00:1A:2B |
QEMU/KVM |
00:50:56 |
VMware (alternate) |
08:00:27 |
VirtualBox |
52:54:00 |
QEMU (alternate) |
MAC Generation Algorithm
JavaScript MAC Address Generation:
function generateMAC(type, format) {
let bytes = [];
// Set first byte based on address type
switch(type) {
case 'unicast-local':
bytes[0] = 0x02; // 0000 0010: local=1, multicast=0
break;
case 'multicast-local':
bytes[0] = 0x03; // 0000 0011: local=1, multicast=1
break;
case 'unicast-global':
// Random even first byte (multicast bit = 0)
bytes[0] = Math.floor(Math.random() * 128) * 2;
break;
default: // random
bytes[0] = Math.floor(Math.random() * 256);
}
// Generate remaining 5 random bytes
for (let i = 1; i < 6; i++) {
bytes[i] = Math.floor(Math.random() * 256);
}
// Format output
const hex = bytes.map(b =>
b.toString(16).padStart(2, '0').toUpperCase()
);
switch(format) {
case 'colon': return hex.join(':');
case 'dash': return hex.join('-');
case 'dot': return hex.join('').match(/.{1,4}/g).join('.');
default: return hex.join('');
}
}
// Usage:
const mac = generateMAC('unicast-local', 'colon');
console.log(mac); // e.g., "02:A4:B7:C3:D8:E1"
Common Use Cases
- Virtual Machine Networking: Assign unique MACs to VMs in VirtualBox, VMware, KVM, Hyper-V
- Container Networks: Generate MACs for Docker bridge networks, Kubernetes CNI plugins
- Network Testing: Simulate multiple devices for load testing, switch testing
- Privacy Protection: Use randomized MACs on public WiFi to prevent tracking
- Lab Environments: Avoid MAC conflicts between lab and production networks
- Software Development: Mock network interfaces for testing network applications
- MAC Filtering Tests: Test network access control lists with various MAC patterns
Locally Administered vs Globally Unique
Globally Unique MAC (OUI-assigned): First byte: Even number (multicast bit = 0) Second bit: 0 (global/administered by IEEE) Example: 00:1A:2B:3C:4D:5E (QEMU OUI) Use when: Emulating specific hardware, production systems Locally Administered MAC: First byte: 02, 06, 0A, 0E, etc. (second bit = 1) Second bit: 1 (locally administered) Example: 02:00:00:00:00:01 Use when: VMs, testing, privacy, avoiding conflicts Why use locally administered for generated MACs: - Avoids conflicts with real hardware MACs - Clearly identifies software-generated addresses - No IEEE registration required - Safe for testing and development
MAC Address Validation
Valid MAC addresses must meet these criteria:
- Length: Exactly 6 bytes (48 bits, 12 hex digits)
- Characters: Only hexadecimal (0-9, A-F, case insensitive)
- Format: Consistent separator (all colons, all dashes, or none)
- Broadcast: FF:FF:FF:FF:FF:FF is valid but reserved
- Null: 00:00:00:00:00:00 is typically invalid for real interfaces
How to Generate MAC Addresses
- Set count: Enter the number of MAC addresses to generate (1-100).
- Choose format: Select colon, dash, dot, or plain hex format.
- Select type: Choose unicast/multicast and local/global administration.
- Click Generate: Random MAC addresses are created instantly.
- Copy result: Click "Copy" to use the addresses elsewhere.
Tips
- Use "Unicast, Locally Administered" for VM and container networking
- Colon format works best for Linux/macOS; dash for Windows
- Dot notation is required for Cisco device configurations
- Generate multiple addresses at once for bulk VM deployments
- Avoid FF:FF:FF:FF:FF:FF (broadcast) and 00:00:00:00:00:00 (null)
Frequently Asked Questions
- What is a MAC address?
- A MAC (Media Access Control) address is a 48-bit (6-byte) identifier assigned to network interfaces for communication at the data link layer. It consists of two parts: the first 24 bits (3 bytes) are the OUI (Organizationally Unique Identifier) assigned by IEEE to manufacturers, and the last 24 bits are the device-specific serial number assigned by the manufacturer.
- What are the different MAC address formats?
- MAC addresses can be displayed in several formats: Colon-separated (AA:BB:CC:DD:EE:FF) - common in Linux and networking tools; Dash-separated (AA-BB-CC-DD-EE-FF) - used in Windows; Dot notation (AABB.CCDD.EEFF) - Cisco style; Plain hex (AABBCCDDEEFF) - compact form for databases and configuration files.
- What is the difference between unicast and multicast MAC addresses?
- The least significant bit of the first octet determines unicast vs multicast: 0 = unicast (sent to one specific device), 1 = multicast (sent to a group). For example, 02:00:00:00:00:00 is unicast (02 in binary ends in 0), while 03:00:00:00:00:00 is multicast (03 in binary ends in 1). Broadcast address FF:FF:FF:FF:FF:FF reaches all devices on the local network.
- What is a locally administered MAC address?
- The second least significant bit of the first octet indicates administration: 0 = globally unique (assigned by IEEE/OUI), 1 = locally administered (set by software). Locally administered addresses are used for virtual machines, MAC spoofing, privacy features (randomized MACs in WiFi), and network testing. Example: 02:00:00:00:00:00 has the local bit set.
- Why generate random MAC addresses?
- Random MAC generation is used for: VM and container networking (each needs a unique MAC), network testing and simulation, privacy protection (randomized MACs prevent tracking), lab environments (avoid conflicts with production), and software development (mock network interfaces). Always use locally administered range (02, 06, 0A, 0E) for generated addresses.
- Can MAC addresses be spoofed or changed?
- Yes, most operating systems allow MAC address changes through software (MAC spoofing). This is legal for privacy and testing but may violate network policies. Uses include: privacy on public WiFi, bypassing MAC filtering (if authorized), testing network access controls, and virtualization. Many modern devices now use randomized MACs by default when scanning for networks.