Networking

IPv6 prefix calculator

Expands and compresses an IPv6 address, finds the prefix, the first and last address, and how many /64 subnets it holds.

Compressed or full form.

Result

Prefix
2001:db8:4f2a:1200::/56
First address
2001:db8:4f2a:1200::
Last address
2001:db8:4f2a:12ff:ffff:ffff:ffff:ffff
Expanded address
2001:0db8:4f2a:1200:0000:0000:0000:0001
Compressed address
2001:db8:4f2a:1200::1
Addresses in prefix
2^72 (4.722 × 10^21)
/64 subnets in prefix
256

Formula

Prefix = address AND mask, where the mask is prefix-length ones followed by zeros across 128 bits. Last address = prefix OR the inverted mask. /64 subnets = 2^(64 − prefix).

Assumptions

  • Compression follows RFC 5952: lowercase, leading zeros dropped, and the longest run of zero groups replaced with "::".
  • IPv6 has no broadcast address; every address in a /64 can be assigned.

Questions

How many /64 networks are in a /48?
65,536. A /48 leaves 16 bits for subnetting before the /64 boundary, and 2^16 is 65,536.
Why is /64 the standard subnet size?
Stateless address autoconfiguration (SLAAC) builds interface identifiers from 64 bits, so LAN segments use /64.

Related tools