IPv4 uses 32-bit addresses written as four decimal numbers (192.0.2.10); there are only about 4.3 billion of them, and the free pool has run out, which is why almost every home and office hides behind NAT. IPv6 uses 128-bit addresses written in hexadecimal (2001:db8::10), enough to give every device a globally unique address again, and it simplifies the header and automatic configuration. In practice you run both; new networks should treat IPv6 as a first-class citizen rather than an afterthought.
At a glance
| Property | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Total addresses | 2^32 = 4,294,967,296 | 2^128 ≈ 3.4 × 10^38 |
| Notation | Dotted decimal: 192.0.2.10 |
Eight hex groups, zeros compressed: 2001:db8::10 |
| Header | 20 to 60 bytes, variable, with a checksum | Fixed 40 bytes, no checksum, extension headers |
| Fragmentation | Sender or any router | Sender only (routers never fragment) |
| Minimum MTU | 68 bytes (576-byte datagrams must be accepted) | 1,280 bytes |
| Address configuration | Manual or DHCP | SLAAC, DHCPv6 or manual |
| Address resolution | ARP (broadcast) | Neighbor Discovery (ICMPv6, multicast) |
| Broadcast | Yes | No; multicast replaces it |
| NAT | Ubiquitous | Not needed (NAT64/NPTv6 exist for special cases) |
| Loopback | 127.0.0.1 (all of 127.0.0.0/8) |
::1 |
| Private / local addresses | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 |
Unique local fc00::/7 (in practice fd00::/8) |
| Link-local | 169.254.0.0/16 (fallback only) |
fe80::/10 (always present) |
| Typical LAN subnet | /24 = 256 addresses |
/64 = 18,446,744,073,709,551,616 addresses |
| DNS record | A |
AAAA |
| Reverse DNS zone | in-addr.arpa |
ip6.arpa |
IPv4
IPv4 has carried the internet since 1983. Its address space was divided into classes, then into CIDR blocks (see the CIDR and Subnet Mask Cheat Sheet), and finally stretched with NAT, which lets a whole network share one public address. NAT works, but it breaks end-to-end connectivity: incoming connections need port forwarding, peer-to-peer applications need relays, and carrier-grade NAT means many customers share a single address, which complicates logging and abuse handling.
Plan IPv4 subnets with the IPv4 Subnet Calculator, and see the bits behind an address with the IPv4 to Binary Converter.
IPv4 is still required when you must reach services or customers that have no IPv6, or you manage legacy equipment and software that cannot speak it. Every public service should remain reachable over IPv4 for now.
IPv6
IPv6 addresses are long, so the notation has two shortcuts: leading zeros in each group can be dropped, and one run of all-zero groups can be replaced by ::. 2001:0db8:0000:0000:0000:0000:0000:0010 and 2001:db8::10 are the same address; convert with the IPv6 Address Compressor and IPv6 Address Expander.
A LAN normally gets a /64, and devices build their own addresses inside it with SLAAC from the router's advertisements; a site typically receives a /48 or /56 from its provider and splits it into /64s (the IPv6 Subnet Calculator shows the arithmetic). For internal-only addressing, generate a random unique local prefix with the IPv6 ULA Generator instead of inventing one.
Choose IPv6 first when you build anything new: mobile networks and large providers already carry a large share of traffic over it, it avoids NAT complexity, and cloud providers increasingly charge for public IPv4 addresses.
Which should you choose?
- New network or service: dual stack, with IPv6 configured properly from day one.
- Public website or API: publish both
AandAAAArecords. - Internal network that will never touch the internet: either works; IPv6 ULAs avoid collisions when networks merge, unlike reused
10.xranges. - Firewall rules: write them for both protocols. A rule set that only covers IPv4 leaves IPv6 wide open.
- Logging and allow-lists: store addresses in a field large enough for IPv6, and match IPv6 clients by prefix (a
/64is one subscriber), not by single address.
For how prefixes and masks divide an address space, see How Subnetting Works.