IPv6 Subnet Calculator: Prefix, /64s and ip6.arpa

This IPv6 subnet calculator compresses and expands addresses to the RFC 5952 form, shows the first and last address of any prefix, counts how many /64 subnets it holds, identifies the address type (global unicast, ULA, link-local and more) and builds the ip6.arpa reverse zone. It also lists the subnets you get when you split a prefix.

Result

The result updates automatically as you change any input.

Formula and worked steps
Formulas used
  • Addresses in a prefix = 2^(128 - n)
  • Number of /64 subnets = 2^(64 - n) for n up to 64
  • Compression (RFC 5952): lower case, no leading zeros, :: for the longest run of two or more zero groups (first on a tie)
  • ip6.arpa zone = the prefix nibbles in reverse order, dot separated, then ip6.arpa (RFC 3596)
  • Split into /s: 2^(s - n) subnets
Assumptions
  • Address types follow the IANA IPv6 special-purpose and unicast registries; the 2000::/3 block is reported as global unicast.
  • /64 is assumed for ordinary LANs because SLAAC needs a 64-bit interface identifier.
  • For prefixes that do not end on a nibble (multiple of 4 bits), reverse delegation needs several ip6.arpa zones; the tool lists them.
References

What is an IPv6 subnet calculator?

IPv6 addresses are 128 bits, written as eight groups of up to four hexadecimal digits. A prefix such as 2001:db8:abcd:1230::/60 keeps the first 60 bits fixed and leaves 68 bits free. Unlike IPv4 you rarely count hosts, because even a single /64 holds 2^64 addresses, 18,446,744,073,709,551,616 of them. The useful questions are how many /64 subnets a prefix contains, what kind of address it is and how to write it correctly.

Compression and expansion

RFC 5952 defines one canonical text form. Leading zeros in each group are dropped, letters are lower case, and the longest run of two or more all-zero groups is replaced by two colons. If two runs tie, the first one is replaced, and a single zero group is never replaced. So 2001:0db8:0000:0000:0000:ff00:0042:8329 is written 2001:db8::ff00:42:8329. Writing every address the same way makes logs, ACLs and searches match.

Address types

Global unicast addresses come from 2000::/3. Unique local addresses (ULA) are fc00::/7, in practice fd00::/8 with a random 40-bit global ID, and are for private use inside a site (RFC 4193). Link-local addresses are fe80::/10 and only work on one link. Multicast is ff00::/8. The documentation prefixes 2001:db8::/32 and 3fff::/20 are for examples and must not be routed.

How the IPv6 subnet calculator works

Formulas

Addresses in a prefix = 2^(128 − n). The number of /64 subnets inside a prefix of length n is 2^(64 − n), so a /48 holds 65,536 and a /56 holds 256. The calculator uses exact integer arithmetic, so large counts are not rounded.

Worked example: 2001:db8:abcd:1230::/60

A /60 has 4 bits between the prefix and the /64 boundary, so it contains 2^4 = 16 subnets. They run from 2001:db8:abcd:1230::/64 to 2001:db8:abcd:123f::/64. Entering 64 in the split field lists them. The reverse zone for this prefix is 3.2.1.d.c.b.a.8.b.d.0.1.0.0.2.ip6.arpa, because the 60 prefix bits are 15 hex digits, written one per label in reverse order.

Point-to-point links and /127

Older guidance used /126 or /64 on router links. RFC 6164 recommends /127, which avoids a neighbour-cache exhaustion attack and a ping-pong loop on links that are not really point to point at layer 3. Both addresses of a /127 are usable. The calculator flags /127 and /128 so you can see which case you are in.

Why /64 matters

Stateless address autoconfiguration (RFC 4862) builds a 64-bit interface identifier, so a LAN with hosts that autoconfigure must be a /64. A prefix longer than /64 on such a segment breaks SLAAC, and a prefix shorter than /64 is an allocation you carve into subnets. The calculator adds a note when a prefix falls on either side of that boundary.

Reverse DNS zones

Reverse lookups for IPv6 live under ip6.arpa and are delegated on nibble boundaries (RFC 3596). A /48 or /64 maps to one zone. A /62 does not fall on a nibble, so it needs four /64 zones, and the calculator lists them (up to eight) with the total count.

Planning a site allocation

A typical enterprise receives a /48 for a site, which holds 65,536 subnets. A common layout reserves the first bits of the subnet field for function or building and the rest for the VLAN number, so a subnet ID such as 0x0a14 can be read at a glance. RFC 6177 no longer recommends one fixed end-site size, so you will also meet /56 allocations (256 subnets) and /60 allocations (16 subnets); the calculator shows the count for whatever you are given.

Writing prefixes in documents

Write the prefix, not an example address, when you document a subnet, and always include the length. A bare 2001:db8:1:: could mean a host or a network. Use lower case, drop leading zeros and apply :: once, exactly as the calculator prints. For ACLs and firewall rules paste the compressed output so that text searches and diffs line up.

What the split list is for

Splitting a /48 into /64 subnets produces 65,536 lines, so the list shows the first 16 and the count. That is enough to check the boundaries, such as that the second /64 of 2001:db8:abcd::/48 starts at 2001:db8:abcd:1::. For a full allocation table, export the first rows and extend the pattern in your IPAM or spreadsheet.

Why it matters for network engineers

IPv6 plans are made once and live for years, so mistakes in the addressing scheme are costly to undo. A clear map of which bits mean site, building, VLAN and function keeps the plan summarisable and the access lists short. Knowing how many /64 subnets you really have also stops over-generous carving that leaves no space for a new site. If a design also runs IPv4, plan both with the IPv4 subnet calculator and keep the two schemes aligned where you can, for example by using the same VLAN number in both.

Best practices and common mistakes

Give every LAN a /64 and do not try to save addresses; the space is not scarce. Use ULA for internal-only services, but do not rely on it as a security boundary. Standardise on the RFC 5952 text form in documentation and monitoring so an address has one spelling. Remember that zone identifiers such as %eth0 are local to a host and are stripped here.

A common error is typing the :: twice, which is invalid. Another is treating the interface identifier as a place to hide hosts: scanning a /64 is not practical, but addresses leak through DNS, logs and neighbour discovery anyway. When you need different subnet sizes, plan the IPv4 side with the VLSM calculator and use the split list here for IPv6, which needs no size juggling. Finally, create the matching ip6.arpa zone when you create the subnet, so reverse lookups work from day one, and set sensible record lifetimes with the DNS TTL propagation calculator.

FAQs

How many /64 subnets are in a /48?

A /48 contains 2^(64 − 48) = 65,536 subnets of /64. A /56 contains 256 and a /60 contains 16.

How do I shorten an IPv6 address?

Remove leading zeros in each group, then replace the longest run of two or more zero groups with ::, once only. Use lower case. This is the RFC 5952 form.

What is a unique local address?

A ULA is a private IPv6 address in fc00::/7, normally fd00::/8 with a random 40-bit global ID (RFC 4193). It is routable inside a site but not on the public internet.

Should I use /127 on router links?

RFC 6164 recommends /127 for inter-router links. It avoids neighbour-table exhaustion and ping-pong problems that can occur with /126 or /64 on point-to-point links.

Next, try the IPv4 subnet calculator, the VLSM calculator and dns-ttl-propagation-calculator, or browse all IP & Addressing calculators and the full list of network calculators.