IPv6 Subnet Calculator

Calculate network prefix, address range, interface ID and compressed/expanded notation from any IPv6 CIDR. Everything is computed in your browser.

Updated:

100% client-side

Subnet input

Network bits Host bits

Results

Compressed address
—
Expanded address
—
Address type
—
Network prefix
—
Address range
—
Interface ID (last 64 bits)
—
Total addresses
—
/64 subnets in this block
—
CIDR notation
—

What is IPv6 subnetting?

IPv6 is the newer, much larger address space that's gradually replacing IPv4 — instead of 32 bits it uses 128, written as 8 groups of hex digits like 2001:db8:1234::1. Subnetting an IPv6 address means splitting that huge address space into smaller networks using a prefix (like /64) that marks how many leading bits are the fixed "network" portion. It's the same idea as IPv4 CIDR, just with a far bigger number space and no broadcast address to worry about.

How to use IPv6 Subnet Calculator

  1. Enter an address in IPv6 address (or click Example for a sample).
  2. Enter a prefix length in Prefix — e.g. /64.
  3. Read the compressed/expanded forms, network prefix, address range and interface ID under Results.
  4. Click Copy to copy the full result.

How IPv6 subnetting works

An IPv6 address is a 128-bit number, written as 8 groups of 4 hex digits. A prefix length (/64) works exactly like IPv4 CIDR, just out of 128 bits instead of 32: it fixes how many leading bits are the network portion, leaving the rest as host bits. Unlike IPv4, IPv6 has no broadcast address — every address in the block, including the all-zeros one, is a valid host:

For how prefix lengths work in IPv4 and IPv6, with a cheat sheet, read the guide CIDR Notation and Subnetting, with a Cheat Sheet.

2001:db8:1234::1/64
→ Network prefix:  2001:db8:1234::/64
→ Address range:   2001:db8:1234:: – 2001:db8:1234:0:ffff:ffff:ffff:ffff
→ Interface ID:    0000:0000:0000:0001
→ Total addresses: 18,446,744,073,709,551,616  (2^64)

RFC 5952 defines the canonical text form used above: hex digits are lowercase, leading zeros are dropped from each group, and :: replaces the single longest run of consecutive all-zero groups — used at most once per address, and never for a lone zero group (so 2001:db8:0:1::1 keeps its single 0 written out). This tool builds the address as a real 128-bit integer (JavaScript's native numbers only give you 53 safe bits, nowhere near enough) and runs every calculation — network, range, and the interface split — with exact big-integer arithmetic, the same category of bug that has bitten IPv4-only tools ported carelessly to IPv6.

Examples

1. Planning subnets inside a /48 allocation. An ISP or RIR assigns you a /48 and you need to know how many /64 LANs fit. Pasting the address in full, zeros included, also gives you the compressed form to use in configs. Python's ipaddress.ip_network('2001:db8:abcd::/48') gave the same first and last address and the same 280 total:

Address 2001:db8:abcd:0012:0000:0000:0000:0001   Prefix /48

Compressed address         2001:db8:abcd:12::1
Address type               Documentation (RFC 3849)
Network prefix             2001:db8:abcd::/48
Address range              2001:db8:abcd:: – 2001:db8:abcd:ffff:ffff:ffff:ffff:ffff
Total addresses            1,208,925,819,614,629,174,706,176 (2^80)
/64 subnets in this block  65,536 (2^16)

2. Reading a link-local address from ip addr. Every IPv6 interface has an fe80:: address that only works on the local link. The last 64 bits are the interface ID; an ff:fe in the middle, as here, usually means it was derived from the interface's MAC address (modified EUI-64), which is why many systems now use random interface IDs instead:

Address fe80::1a2b:3cff:fe4d:5e6f   Prefix /64

Expanded address             fe80:0000:0000:0000:1a2b:3cff:fe4d:5e6f
Address type                 Link-Local
Network prefix               fe80::/64
Interface ID (last 64 bits)  1a2b:3cff:fe4d:5e6f
/64 subnets in this block    1 (2^0)

For the IPv4 side of a dual-stack network, use the IP subnet calculator. If these prefixes send email, they belong in your SPF record as ip6: mechanisms; the DNS record validator checks that record.

Reference: RFC 4291 (IPv6 Addressing Architecture).

Frequently asked questions

What does an IPv6 prefix length mean?

An IPv6 prefix length (e.g. /64) is exactly like IPv4 CIDR notation but out of 128 bits instead of 32: it says how many leading bits of the address are the fixed network portion. /64 is the conventional boundary for a single LAN segment — the remaining 64 bits are the interface ID.

Why doesn't IPv6 have a broadcast address?

IPv6 removed broadcast entirely (RFC 4291) in favor of multicast. Every address in a subnet, including the all-zeros network address, is a valid unicast host address — there's no address to subtract for broadcast like IPv4's .255, so a /64 has 2^64 usable addresses, not 2^64 minus 2.

What's the difference between compressed and expanded notation?

Expanded notation writes all 8 groups of 4 hex digits with no shortcuts. Compressed notation (RFC 5952) is the canonical form: leading zeros are dropped from each group, and "::" replaces the single longest run of consecutive all-zero groups — used once per address, and never for just one zero group.

What's the difference between link-local, unique local, and global unicast addresses?

Link-local (fe80::/10) never leaves the local network segment and is auto-assigned on every interface. Unique local (fc00::/7, RFC 4193) is IPv6's equivalent of private IPv4 ranges — routable within an organization but not on the public internet. Global unicast (2000::/3) is publicly routable, assigned by IANA down to individual networks.