Computer science
IPv6 subnet calculator
Type an IPv6 address with its prefix, for example 2001:db8:abcd:12::1/48: the calculator shows the network, the range, the address forms, the type and how to split the block into subnets.
How IPv6 subnets work
An IPv6 address is 128 bits long, written as eight groups of four hex digits. Leading zeros in each group can be dropped, and one run of all-zero groups can be replaced by ::. So 2001:0db8:0000:0000:0000:ff00:0042:8329 becomes 2001:db8::ff00:42:8329, the form RFC 5952 recommends.
The prefix says how many leading bits identify the network. Local networks almost always use /64, because SLAAC autoconfiguration needs 64 bits for the host; a company or site is often given a /48, which holds 65,536 /64 subnets, and a home connection a /56, with 256 subnets.
IPv6 has no network and broadcast addresses to set aside as IPv4 does: every address in the block is usable and broadcast is replaced by multicast. The numbers become huge, 2⁶⁴ addresses in a single /64, which is why planning is done in subnets rather than individual hosts.
Common mistakes
- Using :: twice in one address: it would be ambiguous how many zero groups each stands for.
- Splitting a LAN into subnets smaller than /64: SLAAC and many IPv6 features stop working.
- Working out subnets in decimal: boundaries fall on hex digits, each worth 4 bits.
Frequently asked questions
How many addresses does a /64 have?
2⁶⁴, that is 18,446,744,073,709,551,616: more than the whole IPv4 space squared.
What is the ip6.arpa zone?
The domain used for reverse lookups, from address to name: the address's 32 hex digits are written backwards, separated by dots, followed by ip6.arpa.
How is an IPv6 address written in a URL?
In square brackets, so the colons are not mistaken for the port: http://[2001:db8::1]:8080/.
How this calculation works
The address is read as a 128-bit integer (expanding :: into the missing zero groups and turning any IPv4 tail into two groups). Mask = 128 − prefix trailing zero bits; network = address AND mask; last address = network OR NOT mask; addresses = 2^(128 − prefix). There are 2^(n − prefix) /n subnets, each of 2^(128 − n) addresses. The compressed form follows RFC 5952: lowercase, no leading zeros and :: over the longest run of at least two zero groups.