What is the CIDR Subnet Calculator?
Takes an IPv4 or IPv6 block in CIDR notation and works out its network address, broadcast address, subnet mask, and usable host range.
How it works
For IPv4, the prefix length is turned into a subnet mask with a bit shift; ANDing the mask with the input address gives the network address, and ORing with the inverted mask gives the broadcast address. All of the math runs on BigInt so it stays accurate past the 32-bit integer limit, and the host list is built the same way — capped at 65,536 addresses, with only the first and last 50 shown for anything larger so the browser tab doesn't lock up. IPv6 blocks get the same address math but are never enumerated, since even a small prefix can hold more addresses than could ever be listed.
SysAdmin & security use cases
- Working out the usable IP range before assigning a subnet in a VPC
- Double-checking that a firewall rule's CIDR actually covers the hosts you intend
- Verifying a route table or BGP announcement matches the subnet you expect
- Getting a plain list of every usable address in a small /28 or /29 block