InfyCalculator
💻

IPv6 Subnet Calculator

Calculate an IPv6 network from an address and prefix length: compressed and expanded network, first and last address, total addresses, address type, and the subnets (e.g. /64s) it can be split into.

IPv6 address
Prefix length
New subnet prefix length
Loading calculator…

How it works

network = address with the last (128 − prefix) bits set to 0 · last address = network + 2^(128 − prefix) − 1 · subnets of length n = 2^(n − prefix) · compressed form (RFC 5952): drop leading zeros in each 16-bit group and replace the longest run of two or more zero groups with ::

An IPv6 address is 128 bits written as eight 16-bit hexadecimal groups. The prefix length marks how many leading bits identify the network (RFC 4291). Sites typically receive a /48 or /56 and give every LAN a /64, because SLAAC address autoconfiguration needs 64-bit interface identifiers — so the useful number is how many /64s you get, not how many hosts. Addresses are shown in the canonical compressed text form defined by RFC 5952 and in fully expanded form.

Worked example

For 2001:db8:abcd:12::1 with a /48 prefix the network is 2001:db8:abcd::/48 (expanded 2001:0db8:abcd:0000:0000:0000:0000:0000), running to 2001:db8:abcd:ffff:ffff:ffff:ffff:ffff. It holds 2^80 (1.21 × 10^24) addresses and splits into 65,536 /64 subnets; 2001:db8::/32 is the documentation range.

Sources: RFC 4291 — IP Version 6 Addressing Architecture · RFC 5952 — A Recommendation for IPv6 Address Text Representation

Frequently asked questions

How many /64 subnets are in a /48?

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

Why is /64 the standard IPv6 subnet size?

Stateless address autoconfiguration (SLAAC) and many other IPv6 features assume a 64-bit interface identifier. Smaller LAN subnets break SLAAC, so /64 is used even for tiny networks; /127 is used for point-to-point links.

How do you compress an IPv6 address?

Remove leading zeros from each group and replace the single longest run of consecutive all-zero groups with "::". 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1.

What prefix will my ISP give me?

Commonly a /56 for home connections (256 /64s) and a /48 for businesses, though some ISPs hand out a /60 or a single /64.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.