Skip to content

PubWeb

Tools

IPv6 subnet calculator

IPv6 subnet calculator: expand, compress and split any prefix

Paste an IPv6 address with its prefix to see the network, its first and last address and how many /64 subnets it holds. Then split it into longer prefixes.

Runs in your browser. What you type stays on this page.

IPv6 subnet calculator

Runs in your browser. What you type stays on this page.

How an IPv6 prefix becomes a range

An IPv6 address is 128 bits, written as eight groups of four hex digits. The prefix length after the slash says how many leading bits are the network. A /n holds 2^(128 − n) addresses, and the number of /64 subnets inside it is 2^(64 − n). There is no dotted subnet mask and no broadcast address: the range starts at the network address and ends at the address with every host bit set to 1.

The tool opens on 2001:db8:abcd:12::1/64, which expanded is 2001:0db8:abcd:0012:0000:0000:0000:0001. Its network is 2001:db8:abcd:12::/64, the range ends at 2001:db8:abcd:12:ffff:ffff:ffff:ffff, and it holds 18,446,744,073,709,551,616 addresses (2^64), exactly one /64. The address sits in 2001:db8::/32, the block reserved for documentation, and its reverse DNS zone is 2.1.0.0.d.c.b.a.8.b.d.0.1.0.0.2.ip6.arpa.

A 128-bit address does not fit in an ordinary JavaScript number, which keeps only 53 bits exact, so the tool works with exact 128-bit integers and prints every digit, with the power of two beside it.

How to use it

  1. Paste the address in IPv6 address and prefix, in full or compressed form, for example 2001:db8::/48. Without a /prefix it reads a single address (/128).
  2. Read the results as you type: Network, Compressed address, Expanded address, First address, Last address, Total addresses and /64 subnets inside.
  3. Check Address type to see which block the network belongs to, and copy Reverse DNS zone when you set up an ip6.arpa delegation.
  4. To cut the network into longer prefixes, choose one in Split into smaller subnets. Each option shows how many subnets it makes, up to 256.
  5. Press the copy button beside the list heading (Copy all subnets) to take every prefix, one per line.
  6. Press Example to reload the sample address, or Clear to start over.

Why /64 is the standard LAN size

IPv6 hosts use the last 64 bits as their interface identifier, and stateless address autoconfiguration (SLAAC) expects exactly that. So a LAN is a /64 even with three devices on it, and IPv6 plans are sized in /64s, not in hosts. The /64 subnets inside row tells you how many LANs a prefix gives you; for a prefix longer than /64 it says none.

Longer prefixes still have uses, such as a /127 on a link between two routers (RFC 6164) or a /128 for one address. The tool computes them too; a /128 cannot be split.

How many /64s fit in a /48, /56 or /60

Count the bits between the prefix and 64. A /48 holds 2^16 = 65,536 /64 subnets, a /56 holds 256, a /60 holds 16, and a /32 holds 4,294,967,296. A customer site is commonly given a /48 or a /56, so a plan usually starts from one of the two.

Type 2001:db8::/48 and choose /56 in Split into smaller subnets: the list gives 256 subnets, from 2001:db8::/56 and 2001:db8:0:100::/56 through 2001:db8:0:ff00::/56. Each of those /56 then holds 256 /64s, and you can paste one back in to split it again.

Compression rules (RFC 5952)

Compressed address follows RFC 5952, the recommended text form: leading zeros dropped in each group, the longest run of two or more all-zero groups written as :: (the first one when two runs tie), a single zero group left as 0, and lowercase hex. So 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. Expanded address does the opposite: eight groups of four digits.

The tool reads any valid spelling, including uppercase, missing leading zeros and an IPv4 ending such as 64:ff9b::192.0.2.1 (its IPv4 inside row then shows 192.0.2.1). It refuses :: used twice, a group longer than four hex digits, more than eight groups, and a zone id such as %eth0, which names an interface on one machine and is not part of the address.

Address types and reverse DNS

Address type names the block the network sits in: global unicast (2000::/3), unique local (fc00::/7, the IPv6 counterpart of private ranges), link-local (fe80::/10), multicast (ff00::/8), documentation (2001:db8::/32 and 3fff::/20), loopback, and transition blocks such as 6to4, Teredo, NAT64 and IPv4-mapped. A network that reaches past the block its first address sits in is marked as mixed.

Reverse DNS zone is the ip6.arpa name of the network: one label per hex digit, read backwards. ip6.arpa delegates on 4-bit boundaries, so for a prefix such as /50 the tool lists the zones you would delegate instead, 4 zones at /52, with the first and the last.

Questions

How many /64 subnets are in a /48?

65,536. Between /48 and /64 there are 16 bits, and 2^16 is 65,536.

How do I compress an IPv6 address?

Drop the leading zeros of each group, then write the longest run of two or more all-zero groups as ::, once only. 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1.

How do I expand an IPv6 address?

Put back the zero groups that :: stands for until there are eight, and pad each group to four digits. 2001:db8::1 becomes 2001:0db8:0000:0000:0000:0000:0000:0001.

What is the IPv6 subnet mask?

IPv6 uses a prefix length instead of a dotted mask: /64 means the first 64 bits are the network. There is no broadcast address in IPv6 either.

What prefix should an IPv6 LAN use?

A /64. Hosts take the last 64 bits as their interface identifier and SLAAC relies on it, so a LAN is a /64 whatever the number of devices.

Why is an address with %eth0 refused?

The part after % is a zone id: it names a network interface on one machine and is not part of the address. Remove it and the address reads.

Is the address I enter sent to a server?

No. The calculation runs in your browser, and the address stays on your device.

All free tools

PubWeb

Measure the sites behind the prefix

PubWeb is an ecosystem of tools for web publishers, made by publishers. Its panel tracks every site with first-party analytics, sets bot and proxy traffic apart, and alerts you when a site goes down or a domain nears expiry.