IPv6 Subnet Calculator
Expand, compress and subnet IPv6 addresses with prefix and range details.
About IPv6 Subnet Calculator
An IPv6 address is 128 bits, usually written as eight groups of four hex digits. The prefix length says how many leading bits identify the network. Applying the prefix mask gives the network address; the remaining host bits define the range from the first to the last address, for 2^(128 − prefix) total addresses. This calculator also shows the fully-expanded and RFC 5952-compressed forms.
Formulas
Network address
network = ip AND mask, where mask is the top `prefix` bits set
- ip
- The 128-bit address
- mask
- The prefix mask — `prefix` leading 1-bits, the rest zero
- prefix
- Prefix length, 0–128
Address count
count = 2^(128 − prefix)
- 128 − prefix
- Host bits — the part of the address free to vary
Worked example
With the default values below, IPv6 Subnet Calculator returns Network / Prefix of 2001:db8:85a3::/64. Change any input above and every figure here is recalculated in your browser.
Inputs used
- IPv6 Address
- 2001:db8:85a3::8a2e:370:7334
- Prefix Lengthaccepts 0–128 /
- 64 /
Results
- Network / Prefix
- 2001:db8:85a3::/64
- Compressed Address
- 2001:db8:85a3::8a2e:370:7334
- Full (Expanded) Address
- 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- First Address in Block
- 2001:db8:85a3::
- Last Address in Block
- 2001:db8:85a3:0:ffff:ffff:ffff:ffff
- Total Addresses (power)
- 2^64
- Total Addresses (count)
- 18,446,744,073,709,551,616
- Address Type
- Global Unicast
Step by step
- 1Expand the address to all 128 bits= 2001:0db8:85a3:0000:0000:8a2e:0370:7334Any '::' run is restored to the zero groups it stands for.
- 2Split at the /64 boundary= mask = 64 leading 1-bits
- 3Mask off the host bits to get the network= 2001:db8:85a3::
- 4Set all host bits to get the last address= 2001:db8:85a3:0:ffff:ffff:ffff:ffff
- 5Count the addresses in the block= 18,446,744,073,709,551,616IPv6 blocks are vast by design — a /64 is the standard size for a single subnet.
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Guides that use this calculator
- How to Calculate a Subnet Mask (By Hand and Quickly)Work out subnet masks, network and broadcast addresses and host counts by hand — with the binary shortcuts network engineers actually use.5 min
- What Is CIDR Notation, and Why Did It Replace Network Classes?CIDR explained from first principles: what the slash number means, why classes A/B/C were abandoned, and how to read any prefix at a glance.4 min
Frequently Asked Questions
Why is a /64 the standard subnet size?
IPv6 was designed so each LAN gets a /64, leaving 64 host bits. That's 18.4 quintillion addresses per subnet, which supports stateless address autoconfiguration (SLAAC).
How does '::' compression work?
A single '::' replaces the longest run of consecutive all-zero groups (at least two). It can appear only once in an address. This tool shows both the compressed and fully-expanded forms.
Does IPv6 have broadcast or network/host reserved addresses?
No. IPv6 has no broadcast address, and unlike IPv4 it doesn't reserve the first and last addresses of a subnet, so all 2^(128 − prefix) addresses in the block are usable in principle.
