Subnet calculator
Enter an IPv4 or IPv6 address with a prefix length or subnet mask. You get the network and broadcast addresses, the usable host range, the host count and the masks.
Try 192.168.1.10/24, 10.0.0.0 255.255.240.0, 172.16.5.4/27 or 2001:db8:abcd::/48.
2001:db8::/56
- CIDR block
- 2001:db8::/56
- Network address
- 2001:db8::
- Last address
- 2001:db8:0:ff:ffff:ffff:ffff:ffff
- Total addresses
- 2^72
- Network, written out
- 2001:0db8:0000:0000:0000:0000:0000:0000
More about this size: IPv6 /56 subnets.
Split into smaller subnets
2001:db8::/56 holds 128 subnets of /63. The first 16:
- 2001:db8::/63
- 2001:db8:0:2::/63
- 2001:db8:0:4::/63
- 2001:db8:0:6::/63
- 2001:db8:0:8::/63
- 2001:db8:0:a::/63
- 2001:db8:0:c::/63
- 2001:db8:0:e::/63
- 2001:db8:0:10::/63
- 2001:db8:0:12::/63
- 2001:db8:0:14::/63
- 2001:db8:0:16::/63
- 2001:db8:0:18::/63
- 2001:db8:0:1a::/63
- 2001:db8:0:1c::/63
- 2001:db8:0:1e::/63
How the calculation works
The prefix length says how many leading bits of the address identify the network. Setting every remaining bit to 0 gives the network address, and setting them all to 1 gives the last address in the block, which IPv4 uses as the broadcast address. Everything in between can be assigned to hosts.
For a quick reference without typing, the subnet cheat sheet lists every IPv4 prefix from /0 to /32 with its mask and host count, and each prefix has its own page with worked examples.
Questions
How do I work out how many hosts a subnet holds?
Subtract the prefix length from 32 for IPv4 (or 128 for IPv6) and raise 2 to that power. A /26 leaves 6 host bits, so it holds 2^6 = 64 addresses. In an ordinary IPv4 subnet the first address names the network and the last is the broadcast address, so 62 of the 64 can be given to hosts.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask has a 1 for every network bit, so a /24 is 255.255.255.0. A wildcard mask is the inverse, with a 1 for every host bit, so a /24 is 0.0.0.255. Router access lists and OSPF configuration on Cisco equipment use wildcard masks.
Why do /31 and /32 show no network or broadcast address?
RFC 3021 allows a /31 on point-to-point links, where both addresses are assigned to the two ends and neither is reserved. A /32 is a single address, used for host routes, loopback interfaces and rules that match one IP.
Does IPv6 have a broadcast address?
No. IPv6 has no broadcast; it uses multicast instead. Almost every address in an IPv6 subnet can be assigned, although a normal LAN is a /64 so that stateless address autoconfiguration (SLAAC) works.
Why does my cloud provider give me fewer hosts than this?
AWS and Azure reserve 5 addresses in every subnet and Google Cloud reserves 4 in a subnet's primary range, so a /24 gives 251 or 252 usable addresses there instead of 254. The subnet cheat sheet lists each provider's limits with a link to its documentation.