IPv4 vs IPv6: what is the difference, and do you need both?
IPv4 and IPv6 are two versions of the protocol that gives every device on a network its address. They are not compatible with each other, so most networks run both side by side.
Address size and notation
An IPv4 address has 32 bits, written as four decimal numbers, for example 192.0.2.10. That allows roughly 4.3 billion addresses, which is fewer than the number of internet-connected devices today.
An IPv6 address has 128 bits, written as eight groups of hexadecimal digits, for example 2001:db8:0:0:0:0:0:1. Two rules make these shorter: leading zeros in a group can be dropped, and one run of all-zero groups can be replaced by ::. The address above becomes 2001:db8::1.
Side by side
| IPv4 | IPv6 | |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Notation | Dotted decimal | Hexadecimal with colons |
| Address space | About 4.3 billion | About 3.4 × 1038 |
| Header | 20 to 60 bytes, variable | 40 bytes, fixed |
| Broadcast | Yes | No, uses multicast |
| Typical home setup | Private addresses plus NAT | Every device gets a global address |
Why IPv4 is still everywhere
Network address translation (NAT) lets a whole household share one public IPv4 address, and providers go further with carrier-grade NAT, where many customers share one. This stretched IPv4 by decades, and it also means a lot of software and infrastructure was built around it. Switching everything off is not realistic.
Dual stack: using both
On a dual-stack network, a device has both an IPv4 and an IPv6 address. When it connects to a site that offers both, it tries them in parallel and uses the one that answers first, with a slight preference for IPv6. This behaviour is known as Happy Eyeballs (RFC 8305). If one protocol is broken, users usually do not notice, which is exactly the point.
Things that change with IPv6
- No NAT, so firewalls matter. Devices can be reachable from the internet by default. NAT was never a firewall, but it hid this. Make sure your router blocks unsolicited inbound traffic.
- Several addresses per interface. You will see a link-local address (
fe80::/10), a global address, and often temporary addresses that rotate to protect your privacy (RFC 4941, updated by RFC 8981). - Autoconfiguration. Devices can configure themselves from router advertisements (SLAAC), without a DHCP server.
Check what your connection supports
Ask the IP service for each protocol separately:
curl -4 -s https://whatsmyip.haasje.net curl -6 -s https://whatsmyip.haasje.net
The IPv6 check on the web version does the same in the browser. To see the addresses on your own machine:
# Linux ip -6 addr # Windows ipconfig
Do you need both?
In practice, yes. Keep IPv4 for the parts of the internet that are still IPv4-only, and enable IPv6 where your provider offers it. Disabling IPv6 on a client rarely solves anything and can cause slow connections, because applications then have to wait for fallbacks. If something breaks, look at it with curl -4 and curl -6 instead of turning a protocol off.
For the difference between addresses on your own network and the one the internet sees, read public vs private IP addresses.