Menu

IP and MAC Addressing

Comparing MAC and IP addresses

MAC addresses and IP addresses both identify a device on a network, but they are created and used in very different ways. The table summarises the main differences.

FeatureMAC addressIP address
Assigned byThe manufacturerThe network
Can it change?No, it is fixed in the hardwareYes, when the device joins a different network
Format48 bits, written as 12 hexadecimal digits in six pairsIPv4: 32 bits, four denary groups. IPv6: 128 bits, eight groups of four hexadecimal digits
Used bySwitches, inside a LANRouters, between networks

Who assigns each address

A MAC address is built into the network hardware by the manufacturer before the device is sold, so it stays the same for the whole life of the device. The first half of the address identifies the manufacturer and the second half identifies that individual device, which is why no two devices should share one.

An IP address is given to a device by the network it joins, usually by the router. Move a laptop from a home network to a school network and its MAC address stays exactly the same, but its IP address is replaced with one that suits the new network.

Formats

A MAC address is written in hexadecimal, for example 3A-7D-91-0C-5E-B2. Colons can be used instead of hyphens. Twelve hexadecimal digits make 48 bits, because each digit stands for 4 bits.

An IPv4 address has four denary groups separated by full stops, such as 86.42.17.205, and every group must be from 0 to 255. An IPv6 address uses eight groups of four hexadecimal digits separated by colons, such as 2f4c:00a1:9b3e:0000:1d7f:6a20:44b8:0e91.

Where each is used

Within a LAN, a switch reads the destination MAC address on each packet and sends it out of the port leading to that device. To travel between networks, a router checks the destination IP address on the packet and sends it on towards the network that address belongs to. That is why MAC addresses are only used within the local network, while IP addresses are used to route data between networks.