How to Use CIDR Calculator
Enter an IPv4 address and a prefix length from 0 to 32. The address can be any host address inside the subnet; the calculator applies the prefix mask to find the network address, broadcast address, subnet mask, usable host range, and host count. Prefixes /31 and /32 are shown with no ordinary usable host range.
Formula & Theory - CIDR Calculator
CIDR notation stores the subnet size as a prefix length. The calculator turns that prefix into a 32-bit mask, uses a bitwise AND to clear host bits for the network address, and uses the inverse mask to set host bits for the broadcast address. Host count is based on the remaining host bits, minus the network and broadcast addresses for normal subnets.
mask = 0xffffffff << (32 - prefix)
network = ip & mask
broadcast = network | ~mask
hosts = 2^(32 - prefix) - 2
Use Cases for CIDR Calculator
Use it for subnet planning, router and firewall configuration, lab networks, DHCP range checks, cloud VPC notes, and explaining which addresses belong to a given IPv4 block. It is a quick way to verify a CIDR range before copying it into documentation or configuration.