· 5 min read
IPv4 vs IPv6: what changed
IPv4 ran out of new addresses years ago, and IPv6 was built to replace it. Most connections now use both. This guide compares them, shows how to read an IPv6 address, and explains the one privacy trap that dual-stack networks create.
On this page
The difference in one sentence#
IPv4 addresses are 32 bits long, which allows about 4.3 billion of them. IPv6 addresses are 128 bits long, which allows about 3.4 × 10^38. Almost everything else that differs follows from that: the notation, the way networks are laid out, and whether devices need to share addresses at all.
IPv4 and IPv6 compared#
| IPv4 | IPv6 | |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Notation | Dotted decimal: 203.0.113.42 | Colon-separated hex: 2001:db8::42 |
| Number of addresses | 4,294,967,296 | 340,282,366,920,938,463,463,374,607,431,768,211,456 |
| Header size | 20 to 60 bytes, variable | Fixed 40 bytes |
| Header checksum | Yes | No: left to the layers above and below |
| Fragmentation | By the sender and by routers on the way | By the sender only |
| Broadcast | Yes | No: multicast is used instead |
| Automatic configuration | DHCP | Router advertisements (SLAAC), and DHCPv6 if wanted |
| Address sharing (NAT) | Routine, because of the shortage | Not needed for address supply |
| Typical home subnet | 192.168.1.0/24 | A /64 from a /56 or /48 your ISP delegates |
The specifications are RFC 791 for IPv4 and RFC 8200 for IPv6.
Why the internet still runs both#
IANA handed out the last unallocated IPv4 blocks to the regional registries in February 2011, and the registries have since run out or nearly so. Networks coped in three ways: NAT to share one public address among many devices, a market in which unused blocks are bought and sold, and carrier-grade NAT at the ISP.
IPv6 solves the shortage outright, but it cannot simply replace IPv4. The two do not interoperate directly: an IPv6-only device cannot open a connection to an IPv4-only server without a translator in between. So networks run dual-stack, with both, and every connection picks whichever the destination supports. That is why this site shows an IPv4 and an IPv6 address on the home page, and why a lookup for a site can return both.
Adoption is uneven by country and by ISP. Google publishes what share of its users arrive over IPv6 on its IPv6 statistics page, and APNIC Labs measures it from a different angle, so you can watch it change instead of trusting a figure in an article.
How to read an IPv6 address#
An IPv6 address is eight groups of four hexadecimal digits. Two rules shorten it, and only these two:
- Leading zeros in a group can be dropped.
0db8becomesdb8, and0042becomes42. - One run of consecutive all-zero groups can be replaced by `::`. Only one run, because two would make it impossible to tell how many groups each stands for. When two runs tie, RFC 5952 says to shorten the longer one, or the first if they are equal.
2001:0db8:0000:0000:0000:0000:0000:0042 full form
2001:db8:0:0:0:0:0:42 leading zeros dropped
2001:db8::42 zero run collapsed
::1 loopback, like 127.0.0.1
:: "no address", all zeros
fe80::1 link-local, valid on one link onlyThe first half of a typical address is the network prefix, which your ISP and router decide, and the second half is the interface identifier, which identifies the device on that network. A /64 is the standard size of one subnet. CIDR and subnetting covers the notation, and the subnet calculator accepts IPv6 prefixes too.
What changes for privacy#
The dual-stack leak
A VPN or proxy has to cover both families. One that only tunnels IPv4 leaves your IPv6 traffic going straight out through your ISP, and any site with an IPv6 address will see your real one. The symptom is a VPN that shows a foreign IPv4 address and a home IPv6 address at the same time. The leak test probes each family separately for exactly this.
Addresses that change on purpose
Early IPv6 addresses often embedded the device's hardware address, which made the same device recognisable on every network it joined. Modern systems use temporary addresses that rotate (RFC 4941) and stable but opaque ones per network, so the address you see for outbound connections is normally not one you can be followed by across networks.
No NAT does not mean no protection
With IPv6, every device can have a globally routable address. That is not the same as being reachable: home routers ship with a stateful firewall that blocks unsolicited inbound connections. It does mean the router no longer hides how many devices you have, because each one appears under its own address.
Which one are you using?#
The home page shows both, each probed separately, so you can see whether you have IPv6 at all. From a terminal, this site's plain-text endpoint answers on both families, so you can force each one:
curl -4 https://my-ip-address.in/ip # your IPv4 address, or an error if you have none
curl -6 https://my-ip-address.in/ip # your IPv6 address, or an error if you have noneIf the second command fails and you expected an address, your network or ISP is not offering IPv6, which is common and not a fault. If both work and the two answers look like different people, that is normal too: they are different addresses on the same connection. Paste either into a lookup to see who owns it.
Common questions#
Is IPv6 faster than IPv4?
Not inherently. Measurements vary by network and are often within a few milliseconds of each other. Where IPv6 helps is avoiding carrier-grade NAT, which can add a hop and a bottleneck.
Why did the numbering skip from IPv4 to IPv6?
Version number 5 had already been assigned to an experimental streaming protocol, the Internet Stream Protocol, which never came into general use. The number was skipped rather than reused.
Will IPv4 be switched off?
There is no date. Both will coexist for the foreseeable future, and a growing share of traffic reaches IPv6-capable services over IPv6 without anyone noticing.
Try it on your own connection
- Check your public IP addressSee the address every website sees, with the network and location behind it.
- Test for IP, DNS and WebRTC leaksFind out whether a VPN is really hiding what you think it is.
- Look up any IP address, domain or URLOwner, network, location estimate and risk flags for whatever you paste in.
Sources and further reading
- RFC 8200: Internet Protocol, Version 6 (IPv6) Specification
- RFC 4291: IP Version 6 Addressing Architecture
- RFC 5952: A Recommendation for IPv6 Address Text Representation — The canonical way to write an IPv6 address.
- RFC 4941: Privacy Extensions for Stateless Address Autoconfiguration in IPv6
- Google IPv6 Statistics — The share of users reaching Google over IPv6, by country.
Keep reading
- FundamentalsWhat is an IP address?An IP address is the label that lets devices find each other on a network. What one looks like, who assigns it, and what it can and cannot reveal about you.
- Addressing and routingCIDR notation and subnetting explainedCIDR notation like 192.168.10.0/26 says how many bits name the network. How to read it, calculate a subnet by hand, and split a network into smaller ones.
- Addressing and routingWhat is NAT, and what is CGNAT?NAT lets a whole network share one public IP address. How the translation table works, what carrier-grade NAT changes, and why NAT is not a firewall.
- FundamentalsThe complete guide to IP addressesOne reference for the whole subject: how addresses are built, the reserved ranges you will meet, how they are allocated and routed, and how to read a lookup result.
Published by My IP Address