IPv4 or IPv6: which are you using?

—

Read by this site’s own edge for this visit. Not kept, and no one else is asked.

Convert between IPv4 and IPv6

IPv4 and IPv6, side by side

IPv4IPv6
Address size32 bits128 bits
How many4,294,967,296 (about 4.3 billion)about 3.4 × 1038
Written asFour decimal numbers: 203.0.113.7Eight hexadecimal groups, zeros shortened: 2001:db8::7
In a URLhttp://203.0.113.7/In brackets: http://[2001:db8::7]/
DNS recordAAAAA
Header20 to 60 bytes, variable40 bytes, fixed, with optional extension headers
Header checksumYesNo - left to the layers above and below
FragmentationBy the sender or by routers on the wayBy the sender only
Smallest MTU every link must carry576 bytes to reassemble (68 to forward)1,280 bytes
Finding neighboursARPNeighbor Discovery (ICMPv6)
Getting an addressDHCP, or set by handSLAAC, DHCPv6, or set by hand
BroadcastYesNo - multicast instead
Sharing one addressCommon: NAT puts a home behind one public addressRare: each device usually gets its own
Defined inRFC 791, 1981RFC 1883 in 1995, then RFC 2460, now RFC 8200 (2017)

The same idea in both: equivalent addresses

IPv4IPv6
Loopback (this machine)127.0.0.1 (all of 127.0.0.0/8)::1
Unspecified / any0.0.0.0::
Default route0.0.0.0/0::/0
Private networks10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16fc00::/7 (in practice fd00::/8)
Link-local169.254.0.0/16fe80::/10
Multicast224.0.0.0/4ff00::/8
Every device on the link255.255.255.255 (broadcast)ff02::1 (all-nodes multicast)
For documentation and examples192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/242001:db8::/32, 3fff::/20
Shared by a provider (CGNAT)100.64.0.0/10None needed

From the IANA special-purpose address registries. Check whether any address is private.

How IPv6 addresses are shortened

Two rules, from RFC 5952. Leading zeros in each group are dropped: 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8:0:0:0:0:0:1. Then the longest run of all-zero groups is replaced by ::, once: 2001:db8::1. Letters are written in lower case. The converter above shows any address both ways.

How IPv4 ran out

1981IPv4 defined in RFC 791.
1993CIDR replaces class A, B and C networks, slowing the spending of IPv4.
1995IPv6 first specified, in RFC 1883.
1998IPv6 revised as RFC 2460.
3 February 2011IANA hands its last five /8 blocks to the five regional registries. Its free pool of IPv4 is empty.
15 April 2011APNIC, the Asia-Pacific registry, reaches its final /8.
8 June 2011World IPv6 Day: major sites turn IPv6 on for 24 hours.
6 June 2012World IPv6 Launch: they leave it on.
14 September 2012RIPE NCC, for Europe and the Middle East, reaches its final /8.
10 June 2014LACNIC, for Latin America, reaches its final /10.
24 September 2015ARIN, for North America, runs out of free IPv4.
2017AFRINIC, for Africa, enters its exhaustion phase.
2017IPv6 becomes a full Internet Standard, RFC 8200.
25 November 2019RIPE NCC makes its last ordinary /22 allocation.

By the numbers: what the registries have handed out

Computed from every allocation the five regional internet registries have published (NRO delegated statistics, snapshot of ), the same records the map on the front page is drawn from.

IPv4 handed out3,687,775,072 addresses: 85.9% of all IPv4, and 98.1% of everything below 224.0.0.0 - the rest of that is mostly private and reserved ranges no registry hands out. IPv4 is, for practical purposes, all spoken for.
IPv6 handed out496,573 blocks the size of a /32, about 0.0925% of the 2000::/3 range that all public IPv6 comes from. Put the other way: for every address handed out, about 1,080 more are still waiting.
Countries holding IPv4238, led by the United States (43.6%), China (9.3%), Japan (5.1%), the United Kingdom (3.8%), Germany (3.4%).

IPv4 by registry

ARIN1,645,591,808 addresses44.6%
APNIC889,139,520 addresses24.1%
RIPE NCC854,641,184 addresses23.2%
LACNIC182,257,664 addresses4.9%
AFRINIC116,144,896 addresses3.1%

IPv4 by the decade it was handed out

Before 1990205,607,936 addresses5.6%
1990s1,104,335,360 addresses29.9%
2000s1,314,781,568 addresses35.7%
2010s877,955,104 addresses23.8%
2020s185,095,104 addresses5.0%

IPv6 by registry

RIPE NCC182,339 /32s36.7%
ARIN144,745 /32s29.1%
APNIC140,986 /32s28.4%
LACNIC17,127 /32s3.4%
AFRINIC11,374 /32s2.3%

Free to quote with a link to iphere.app/ipv4-vs-ipv6. Source data: the Number Resource Organization.

Questions

What is the difference between IPv4 and IPv6?

IPv4 addresses are 32 bits long, so there are about 4.3 billion of them, and they have all been handed out. IPv6 addresses are 128 bits, enough for every device to have its own. IPv6 also simplifies the packet header and drops broadcast. The two are not compatible on the wire: a device needs one or the other, or both, to reach a site.

Is IPv6 better than IPv4?

For the internet as a whole, yes: it removes the shortage that forced homes and phone networks behind shared addresses. For one connection, neither is reliably faster or safer. Speed depends on the route, and both carry the same encrypted traffic.

Which one am I using?

The answer at the top of this page is the one this visit actually used. When your network has both, most devices try IPv6 first and fall back to IPv4 if it answers more slowly.

Can an IPv4 address be written as IPv6?

Yes, in several standard ways. ::ffff:192.0.2.1 is the IPv4-mapped form (RFC 4291), and 64:ff9b::192.0.2.1 is how an IPv6-only network reaches it through NAT64 (RFC 6052). The converter above works them out for any address.

Why is IPv4 still used if it ran out?

Because almost everything already speaks it, and NAT lets many devices share one public address. Running out made IPv4 addresses expensive - they are bought and sold - rather than unusable. IPv6 grows alongside it instead of replacing it overnight.

Should I turn IPv6 off?

Usually not. Modern systems are built expecting it, and turning it off can slow some connections or break features. If a particular network misbehaves over IPv6, that is a problem to fix in that network.

See also

What is my IPv6 address? · CIDR and subnet calculator · What is my IP address, and the map of the whole address space around it, drawn from the same registry records.

Updated . Standards: RFC 791 (IPv4), RFC 8200 (IPv6), RFC 4291 (IPv6 addressing), RFC 5952 (IPv6 text form), RFC 6052 (NAT64).