Skip to content
Calcrivo

IPv6 Subnet Calculator

Compute the network prefix, address range, and total addresses for any IPv6 subnet.

Inputs

Full or compressed form, e.g. 2001:db8::1

/

0–128. /64 is the typical LAN prefix.

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

  1. Expand the address to all 128 bits

    2001:db8:85a3::8a2e:370:7334

    = 2001:0db8:85a3:0000:0000:8a2e:0370:7334

    Any '::' run is restored to the zero groups it stands for.

  2. Split at the /64 boundary

    64 network bits, 64 host bits

    = mask = 64 leading 1-bits

  3. Mask off the host bits to get the network

    2001:db8:85a3::8a2e:370:7334 AND /64 mask

    = 2001:db8:85a3::

  4. Set all host bits to get the last address

    2001:db8:85a3:: OR 64 low bits

    = 2001:db8:85a3:0:ffff:ffff:ffff:ffff

  5. Count the addresses in the block

    2^(128 − 64) = 2^64

    = 18,446,744,073,709,551,616

    IPv6 blocks are vast by design — a /64 is the standard size for a single subnet.

How it works

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

Guides that use this calculator

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.

You might also need