IPv4 vs IPv6 explained

A short row of pale gray blocks in front of a longer row of glowing blue glass blocks, suggesting a short address beside a long one.

IPv4 and IPv6 are two versions of the Internet Protocol, the system that gives every connected device an address. IPv4 is the original and still carries a large share of traffic. IPv6 is its replacement, designed with far more addresses. The two are not compatible with each other, so most networks run both at once.

If you want the short answer: you do not have to choose. Your devices and your provider pick the version automatically for each connection. The home page shows which of the two your connection has.

The core difference is size

An IPv4 address is 32 bits long. That gives about 4.3 billion possible addresses, which sounded generous when the protocol was specified in 1981 and is far fewer than the number of devices online today.

An IPv6 address is 128 bits long. The number of possible addresses has 39 digits. Running out is not a practical concern.

The size of an IPv4 address compared with an IPv6 addressAn IPv4 address, 203.0.113.42, is four numbers of 8 bits each, 32 bits in total, which allows about 4.3 billion addresses. An IPv6 address, 2001:0db8:85a3:0000:0000:8a2e:0370:7334, is eight groups of 16 bits each, 128 bits in total, which allows about 340 undecillion addresses.IPv44 numbers, 8 bits each20301134232 bits. About 4.3 billion addresses.IPv68 groups, 16 bits each20010db885a3000000008a2e03707334128 bits. About 340 undecillion addresses,a number with 39 digits.
IPv6 addresses are four times as long as IPv4 addresses, which makes the address space vastly larger.

How to read each one

IPv4 is written as four decimal numbers separated by dots, each from 0 to 255:

198.51.100.7

IPv6 is written as eight groups of four hexadecimal digits separated by colons:

2001:0db8:0000:0000:0000:ff00:0042:8329

Because that is long, two shortcuts are allowed, described in RFC 5952:

  1. Leading zeros in a group can be dropped, so 0db8 becomes db8 and 0042 becomes 42.
  2. One run of all-zero groups can be replaced with a double colon.

Apply both and the address above becomes:

2001:db8::ff00:42:8329

The double colon can appear only once in an address. Otherwise there would be no way to tell how many zero groups each one stands for. The Subnet Calculator shows both the short and the fully written form of any IPv6 address you enter.

Side by side

IPv4 IPv6
Address length 32 bits 128 bits
Written as 198.51.100.7 2001:db8::ff00:42:8329
Total addresses About 4.3 billion About 340 undecillion
Typical home setup One shared public address, private addresses behind NAT A whole block of public addresses, one or more per device
Address setup Usually DHCP Often automatic (SLAAC), sometimes DHCPv6
DNS record type A AAAA
Specification RFC 791 RFC 8200

Why IPv4 ran short

IPv4 addresses were handed out freely in the early years, long before phones, TVs, cars, and doorbells went online. The central pool of unassigned IPv4 blocks is used up, and providers now work with the addresses they already hold or buy more from other organizations.

The industry coped with the shortage in two main ways:

  • NAT lets a whole home or office share one public address. Every device behind the router uses a private address. See public vs private IP addresses.
  • Carrier-grade NAT takes the same idea one level up, so many customers of one provider share a single public address. See what is CGNAT.

Both keep IPv4 working, but they add complexity. Hosting a game server, reaching a security camera from outside, or running a small web server at home all get harder when you do not have a public address of your own.

What IPv6 changes in practice

Every device can have a public address. With IPv6 your provider typically delegates an entire block to your home rather than a single address. Your router hands addresses from that block to each device. There is no need to share, so NAT is usually not involved.

A firewall still protects you. No NAT does not mean no protection. Most home routers block unsolicited incoming IPv6 connections by default, the same result NAT gives for IPv4 as a side effect. It is worth confirming that the IPv6 firewall is switched on in your router’s settings.

Devices can configure themselves. With stateless address autoconfiguration, described in RFC 4862, a device builds its own address from the network prefix the router announces. No server has to hand addresses out.

Addresses rotate for privacy. Most phones and computers generate temporary IPv6 addresses that change regularly, so the second half of your address does not follow you around. The mechanism is defined in RFC 8981.

For everyday browsing none of this is visible. Pages load the same way.

How both run at once

Since an IPv4-only device cannot talk directly to an IPv6-only device, the transition relies on dual stack: devices and networks run both protocols together.

When you open a site, your device looks up both its A record (IPv4) and its AAAA record (IPv6). If both exist, it tries IPv6 first and, if that has not connected within a fraction of a second, tries IPv4 as well and uses whichever connects first. The approach is known as Happy Eyeballs and is specified in RFC 8305. If a site has no AAAA record, your device uses IPv4.

You can check whether a site publishes an IPv6 address with the DNS Lookup tool: query its name for the AAAA type.

Some mobile networks have gone further and run IPv6 only, translating at the edge of the network when a customer needs to reach an IPv4-only site.

Which one do I have?

Open the home page. It reports the address your browser connected with and then tests each protocol separately:

  • Both shown: your connection is dual stack. This is common on modern home broadband and mobile networks, though it varies a lot by country and provider.
  • IPv4 only: your provider, your router, or your device does not have IPv6 switched on. Everything still works.
  • IPv6 only: rare. Your network has no working route to IPv4, or the IPv4 test was blocked. Networks that translate IPv4 for you normally show both.

If you expected IPv6 and do not see it, check that IPv6 is enabled in your router’s settings and that your provider offers it on your plan. A VPN can also hide it, because many VPN services carry only IPv4.

Is IPv6 faster or safer?

Neither version is inherently faster. Speed depends on the route your traffic takes, and that varies by provider and destination. On some networks IPv6 avoids a translation step and has a small edge. On others the IPv4 path is better tuned.

Neither is inherently safer for ordinary use either. Encryption comes from the layers above, such as HTTPS, and works the same over both.

Do I need to do anything?

For most people, no. If your provider and router support IPv6, leave it on. There is no benefit to disabling it, and some services work better with it, especially behind CGNAT.

If you run a website or a service, publish both A and AAAA records so that visitors on either protocol can reach you directly.

Further reading