IPv4 vs IPv6: What's the Difference?

IPv4 and IPv6 are the two versions of the Internet Protocol in use today. IPv4 uses 32-bit addresses and has run out of new ones; IPv6 uses 128-bit addresses, provides an effectively unlimited supply, and simplifies several parts of how networks operate.

IPv4 vs IPv6 at a glance

IPv4IPv6
Address length32 bits128 bits
Number of addresses232 ≈ 4.3 billion2128 ≈ 3.4 × 1038
NotationDotted decimal: 192.0.2.10Hexadecimal with colons: 2001:db8::10
HeaderVariable, 20–60 bytes, with checksumFixed 40 bytes, no checksum, optional extension headers
Address configurationManual or DHCPSLAAC, DHCPv6 or manual
Local address resolutionARP (uses broadcast)Neighbor Discovery (uses multicast)
BroadcastYesNo (replaced by multicast)
FragmentationBy sender or routersBy sender only
NATAlmost universal on home networksNot needed for address sharing
Defined inRFC 791 (1981)RFC 2460 (1998), now RFC 8200

How the address formats differ

IPv4 notation

An IPv4 address is four 8-bit numbers (octets) written in decimal and separated by dots. Each octet ranges from 0 to 255, so 192.0.2.10 is valid but 192.0.2.300 is not. Under the hood it is just one 32-bit integer, which is why the same address can also be written as 3221225994. You can try these conversions with the IP address converter.

IPv6 notation

An IPv6 address is eight groups of 16 bits, each written as up to four hexadecimal digits and separated by colons. Two rules keep them readable:

  • Drop leading zeros in any group: 0db8 becomes db8.
  • Replace one run of all-zero groups with a double colon ::. This can only be done once per address, otherwise the length would be ambiguous.
Full:       2001:0db8:0000:0000:0000:0000:0000:0001
Compressed: 2001:db8::1

RFC 5952 recommends writing IPv6 addresses in lowercase and in their shortest form, which is what most tools display. When you put an IPv6 address in a URL you must wrap it in square brackets so the colons are not mistaken for a port separator, for example http://[2001:db8::1]:8080/.

Prefixes instead of subnet masks

Both versions describe networks with CIDR prefixes, but IPv6 networks are much larger. A standard IPv6 subnet (a single LAN) is a /64, which contains 264 addresses. ISPs commonly delegate a /56 or /48 to each customer, giving a home or business hundreds or tens of thousands of /64 subnets. The subnet calculator handles both IPv4 and IPv6 prefixes.

Why IPv4 ran out

When IPv4 was standardised, 4.3 billion addresses seemed ample. In practice not all of them are usable: large ranges are reserved for private networks, multicast, loopback, documentation and future use, and early allocations handed huge blocks to a small number of organisations. The growth of home broadband, smartphones and cloud computing consumed the rest.

IANA allocated its last free blocks to the five Regional Internet Registries in February 2011. The registries then ran out on their own timelines: APNIC in 2011, RIPE NCC in 2012 (for normal allocations) and ARIN in 2015, with the others following. Today, organisations that need more IPv4 space generally buy or lease it on a secondary market, or reuse returned addresses through waiting lists.

How NAT kept IPv4 alive

The main reason IPv4 still works is Network Address Translation. Your router gives every device at home a private address and rewrites outgoing traffic so it all appears to come from one public address. Many mobile and some broadband providers go further with carrier-grade NAT (CGNAT), sharing one public address among many customers. NAT conserves addresses but breaks end-to-end connectivity: inbound connections need port forwarding, and behind CGNAT they are often impossible. See Public vs Private IP Addresses Explained for how this works.

What IPv6 improves

Enough addresses for everything

With IPv6, every device can have a globally unique address. That restores end-to-end connectivity (subject to your firewall) and removes the need for address-sharing tricks. It also makes peer-to-peer applications, gaming, video calls and self-hosting simpler.

Simpler, faster headers

The IPv6 header has a fixed size and fewer fields. It drops the header checksum (link layers and transport protocols already check for errors), and routers no longer fragment packets; instead the sender uses Path MTU Discovery to pick a packet size that fits. Optional features live in extension headers that most routers can skip over. These changes make forwarding more predictable for hardware.

Automatic configuration

IPv6 hosts can configure themselves using Stateless Address Autoconfiguration (SLAAC): the router advertises the network prefix and each device builds its own address. DHCPv6 is still available when an administrator wants central control. Every IPv6 interface also has a link-local address starting with fe80:: that works even without a router.

Privacy addresses

Early SLAAC derived part of the address from the device's MAC address, which could be used to track a device across networks. Modern operating systems use temporary (privacy) addresses for outgoing connections and rotate them regularly, so websites see a changing address rather than a stable hardware-derived one.

Note: IPv6 is sometimes described as "more secure" because IPsec support was part of the original specification. IPsec is now optional for IPv6 just as it is for IPv4, so the real security of either protocol depends on firewalls and configuration, not the version number.

How IPv4 and IPv6 coexist

IPv4 and IPv6 are not directly compatible: an IPv4-only device cannot talk to an IPv6-only device without a translator. The transition therefore relies on a few techniques:

  • Dual stack: devices and networks run both protocols at once. This is the most common approach for home broadband today.
  • Happy Eyeballs: browsers and operating systems try IPv6 and IPv4 in parallel and use whichever connects first, so a broken IPv6 path does not stall a page load.
  • NAT64 and DNS64: IPv6-only networks, common on mobile carriers, translate to IPv4 when a site has no IPv6 address. 464XLAT adds a small client-side translator so IPv4-only apps still work.
  • Tunnels: IPv6 packets can be carried inside IPv4 (or vice versa) where native support is missing.

Adoption is uneven. According to Google's IPv6 statistics, which measure the share of users reaching Google over IPv6, the figure has risen steadily and is in the region of half of users at the time of writing, but it varies a lot by country and by network. Many mobile networks are heavily IPv6, while plenty of fixed-line ISPs and corporate networks still offer only IPv4.

How to tell which one your connection uses

The quickest way is to run the IPv6 test, which shows your IPv4 and IPv6 addresses side by side and tells you whether IPv6 is working. You can also check locally:

# Windows
ipconfig

# macOS / Linux
ifconfig        # or: ip -6 addr

Look for addresses beginning with 2 or 3 (global unicast IPv6). An address beginning with fe80 is link-local only and does not mean you have IPv6 internet access.

Tip: If your router supports IPv6 but your devices do not get a global IPv6 address, check the router's WAN or Internet settings for an IPv6 option (often labelled "Native", "DHCPv6" or "Auto") and confirm with your ISP that they provide it.

Frequently asked questions

Is IPv6 faster than IPv4?

Not inherently. Speed depends mostly on the route and congestion between you and the server. IPv6 can be slightly faster on networks where it avoids carrier-grade NAT, and slightly slower where the IPv6 route is less direct. In everyday browsing most people will not notice a difference.

Should I disable IPv6?

Generally no. Modern operating systems are designed to have IPv6 enabled, and disabling it can break features or push traffic onto overloaded IPv4 NAT. If you suspect an IPv6 problem, it is better to fix the router or ISP configuration.

Will IPv4 be switched off?

Not any time soon. Huge amounts of equipment and software still depend on IPv4, so the two protocols will coexist for many years. Some networks already run IPv6-only internally and translate to IPv4 at the edge.

Can an IPv4 address be written as IPv6?

Yes. An IPv4-mapped IPv6 address embeds the IPv4 address after ::ffff:, for example ::ffff:192.0.2.10. It is used inside dual-stack software to represent IPv4 connections, not for routing on the internet.

Try it yourself

Put this guide into practice with our free tools.

Keep reading

Copied to clipboard