taap.digitalnetwork engineering toolkit

IPv6 subnet calculator

Enter your allocation, for example 2001:db8:abcd::/48, and the target prefix length. The tool counts the subnets, lists the first ones and shows the expanded form.

subnet6
Close-up of a blue circuit board
Close-up of a blue circuit board. Photo: Yogesh Phuyal / Unsplash

IPv6 subnetting is counting bits

There is no broadcast and no reserved host math in IPv6 planning. The number of subnets of length n inside a prefix of length p is simply:

subnets = 2(n − p)

From a /48 to /64 you borrow 16 bits, so you get 216 = 65,536 subnets. Each /64 holds 264 interface addresses, which is why you never size an IPv6 LAN by host count.

Standard prefix sizes

PrefixTypical use/64s inside
/32Minimum LIR/ISP allocation from an RIR4,294,967,296
/48Enterprise site, PI space from an RIR65,536
/56Residential or small business delegation256
/60Minimal delegation used by some ISPs16
/64One LAN segment (required for SLAAC)1
/127Point-to-point link (RFC 6164)–
/128Loopback, single host–

Worked example: 2001:db8:abcd::/48 into /64s

The fourth hextet (16 bits) becomes your subnet ID. The tool lists them in order:

2001:db8:abcd::/64
2001:db8:abcd:1::/64
2001:db8:abcd:2::/64
...
2001:db8:abcd:ffff::/64

Notation follows RFC 5952: lowercase hex, leading zeros dropped, and the longest run of zero hextets replaced by ::. The expanded row shows all 32 hex digits, which is what you need for reverse DNS (ip6.arpa) zones.

Plan on nibble boundaries

Each hex digit is 4 bits (a nibble). Prefix lengths that are multiples of 4 (/48, /52, /56, /60, /64) keep subnet boundaries aligned with hex digits, so a subnet ID is readable directly from the address and reverse DNS delegation stays clean. A common enterprise layout for a /48:

  • First nibble of the 4th hextet = region or building (16 values).
  • Second nibble = function (users, voice, servers, management…).
  • Last two nibbles = VLAN or segment number (256 values).

Configuration

! Cisco IOS
interface Vlan20
 ipv6 address 2001:db8:abcd:20::1/64

# Junos
set interfaces irb unit 20 family inet6 address 2001:db8:abcd:20::1/64

# Linux
ip -6 addr add 2001:db8:abcd:20::1/64 dev eth0

Rules of thumb

  • Every LAN gets a /64 (RFC 4291 interface IDs are 64 bits). Smaller prefixes break SLAAC and several other features.
  • Use /127 on router-to-router links (RFC 6164), but reserve a full /64 per link in your plan so you can change your mind later.
  • Do not try to conserve space; plan for structure and summarization instead.

Quick answers

Frequently asked questions

How many /64s are in a /48?

65,536 (216).

Why does every LAN need a /64?

SLAAC builds a 64-bit interface identifier, and RFC 4291 fixes the interface ID at 64 bits for unicast addresses outside ::/3. Prefixes longer than /64 on a LAN break autoconfiguration.

Should point-to-point links use /64 or /127?

RFC 6164 recommends /127 on inter-router links to prevent neighbor-cache exhaustion attacks. Many operators allocate a /64 per link and configure a /127 inside it.

What is 2001:db8::/32?

The documentation prefix (RFC 3849). Use it in examples and labs, never in production.

Study and design tool. Validate any configuration in a lab and against vendor documentation before applying it in production.