MAC address vs. IP address explained
In this video, TechTarget editor Jen English talks about MAC and IP addresses.
They're like IDs for your devices.
Every device on the internet has two addresses: a media access control address, or MAC address, and an Internet Protocol address, or IP address. Both addresses are important for sending data over the internet but for different reasons.
Here, we'll go over the primary differences between MAC and IP addresses. Let's compare the two.
Location
The main difference between a MAC and IP address is where they're used.
A MAC address -- sometimes called the physical address -- is responsible for local identification. It's only relevant to the local area network [LAN] a device is connected to -- for instance, a work laptop connected to an office network can send a file to an office printer using the unique MAC address of each device.
Anything sent outside the LAN, anywhere else on the internet, uses the device's public IP address -- sometimes called the logical address. The IP address is primarily responsible for global identification. So you could think of a MAC address like a local library card and the IP address like your passport.
Formatting
A MAC address consists of 12 hexadecimal digits, usually grouped into six pairs separated by hyphens or colons. For nearly all network devices today, this address is hardcoded into a device during manufacturing.
MAC addresses are typically thought of as permanent. But there are circumstances where they can be altered, like replacing a physical network interface card, installing certain firmware or software, or spoofing the address for security or privacy.
IP addresses using the fourth iteration of IP -- IPv4 -- consist of 32 bits usually written as four groups of numbers separated by periods. IPv6 addresses consist of 128 bits written as eight sets of four hexadecimal digits separated by colons. IP addresses are assigned to devices after manufacturing and can be changed at any time, typically by network administrators or dynamically by Dynamic Host Configuration Protocol, or DHCP.
How they work
The MAC address and IP address do different jobs, but they still work together.
For example, say you use a smartphone while on your home network to send an email to a business in a different region. Your smartphone uses its MAC address to communicate with your home router. But, because the email is going to a network outside of your local home network, the data packet needs to include a source and destination IP address. Routers use these IP addresses to forward the packet to its final destination on a different network.
When the packet reaches the business's local network, a router or server uses Address Resolution Protocol to match the destination IP address to the recipient device's MAC address, ensuring the email reaches the correct device.
Jennifer English is executive editor for TechTarget's Networking and Cloud sites. She joined TechTarget as a writer and editor after graduating from the University of New Hampshire in 2016.