radixflip

IPv6 Subnet Calculator

Enter an IPv6 address and a prefix length — everything updates live: network address, first and last address, total addresses and subnet mask.

Calculate Your IPv6 Subnet

2001:db8:abcd:0012::0/64 — network 2001:db8:abcd:12::, 18,446,744,073,709,551,616 total addresses.

IPv6 has no broadcast address — the range runs from the network address to the last address.

Online subnet calculator →  ·  Full calculator (all bases, all operations) →

How to calculate an IPv6 subnet

  1. Enter the IPv6 address and prefix. Type an IPv6 address such as 2001:db8:abcd:0012::0 and a prefix length such as 64. The prefix counts the network bits; the rest are host bits.
  2. Find the network address. Keep the first 64 bits and set the remaining host bits to 0. For 2001:db8:abcd:0012::0/64 the network address is 2001:db8:abcd:12::.
  3. Find the last address. Set all host bits to 1. For a /64 the last address is 2001:db8:abcd:12:ffff:ffff:ffff:ffff.
  4. Count the total addresses. The count is 2 raised to the number of host bits: 128 − 64 = 64 host bits, so 264 = 18,446,744,073,709,551,616 addresses.

Worked example: 2001:db8:abcd:0012::0/64

ValueResult
IPv6 address2001:db8:abcd:0012::0
Prefix/64
Network address2001:db8:abcd:12::
First address2001:db8:abcd:12::
Last address2001:db8:abcd:12:ffff:ffff:ffff:ffff
Total addresses18,446,744,073,709,551,616 (264)
Subnet mask (compressed)ffff:ffff:ffff:ffff::
Subnet mask (full form)ffff:ffff:ffff:ffff:0000:0000:0000:0000

The math: /64 leaves 128 − 64 = 64 host bits. Total addresses 264 = 18,446,744,073,709,551,616 — about 18.4 quintillion. IPv6 has no broadcast address, so nothing is subtracted.

How to calculate an IPv6 subnet in code

Python

import ipaddress

net = ipaddress.IPv6Network("2001:db8:abcd:0012::0/64", strict=False)
print(net.network_address)   # 2001:db8:abcd:12::
print(net.broadcast_address)  # 2001:db8:abcd:12:ffff:ffff:ffff:ffff (last address)
print(net.netmask)            # ffff:ffff:ffff:ffff::
print(net.num_addresses)      # 18446744073709551616

In Python, broadcast_address on an IPv6 network returns the last address of the prefix — IPv6 itself has no broadcast address. The strict=False flag lets you pass a host address instead of the network address itself.

Frequently asked questions

What is an IPv6 subnet calculator?

It is a tool that takes an IPv6 address and a prefix length, like 2001:db8:abcd:0012::0/64, and works out the network address, the first and last address in the range, the total number of addresses, and the subnet mask. Type an address and prefix above and every value updates live — no button to press. IPv6 has no broadcast address, so the range simply runs from the network address to the last address.

How many addresses are in a /64?

A /64 has 2^64 = 18,446,744,073,709,551,616 addresses — about 18.4 quintillion. A /64 leaves 128 − 64 = 64 host bits, so the count is 2 to the power of 64. That is the standard subnet size handed out to a single network, and it is why IPv6 never needs NAT-style address saving.

What is an IPv6 prefix?

An IPv6 prefix is a network written as an address plus a prefix length, like 2001:db8:abcd:12::/64. The number after the slash counts how many leading bits belong to the network. A /64 means the first 64 bits are the network part and the remaining 64 bits identify hosts inside it. Shorter prefixes cover more addresses: a /48 holds 65,536 subnets of /64 size.

What is the network address in IPv6?

The network address is the first address of a prefix, with all host bits set to 0. For 2001:db8:abcd:0012::0/64 the network address is 2001:db8:abcd:12::. It identifies the subnet itself. Unlike IPv4, IPv6 has no broadcast address — the network address is simply the first address of the range.

How do I write a compressed IPv6 address?

Use the RFC 5952 rules: write hex in lowercase with no leading zeros, and replace the longest run of consecutive all-zero groups with a double colon (::). For example, 2001:0db8:abcd:0012:0000:0000:0000:0000 becomes 2001:db8:abcd:12::. The :: may appear only once. This calculator shows every result in compressed form.

What is the difference between IPv4 and IPv6 subnetting?

IPv4 uses 32-bit addresses and subtracts the network and broadcast addresses from the usable count — a /24 gives 254 usable hosts. IPv6 uses 128-bit addresses, has no broadcast address, and does not subtract anything: a /64 has the full 2^64 addresses. IPv6 prefixes are also far bigger: one /64 holds more addresses than the entire IPv4 internet.

Online subnet calculator →  ·  Full calculator (all bases, all operations) →