CIDR Calculator
Find host count and subnet mask from a CIDR prefix.
A CIDR prefix defines how many addresses a subnet holds.
How the Math Works
The CIDR Calculator uses fundamental binary mathematics to determine network sizes. Starting with a CIDR prefix (like /24), the formula 2^(32 - prefix) calculates total IP addresses by recognizing that each bit position can hold two states (0 or 1). For a /24 network, that's 2^8 = 256 total addresses. Since network and broadcast addresses can't be assigned to hosts, we subtract 2 using the formula hosts = addresses - 2, giving 254 usable host addresses. This exponential relationship means each decrease in prefix length doubles the address space.
Practical Applications
Network administrators use this calculation when designing subnet schemes for organizations. If you need 100 devices on a single network segment, the calculator reveals you need a /25 subnet (128 addresses, 126 usable hosts) rather than wasting an entire /24 block. When expanding a company's network, you can determine how many /26 subnets (62 hosts each) fit within a larger allocation. The tool also validates whether proposed network designs meet requirements, preventing costly misconfigurations that could waste IP space or fail to accommodate all devices.
Day-to-Day Use
This calculator quietly enables the digital infrastructure we rely on daily. When your phone connects to WiFi, these calculations ensure your network can accommodate all smart devices, printers, and computers without running out of addresses. For remote workers setting up home offices, understanding subnet sizes helps configure routers properly so video calls, cloud storage, and smart home devices all communicate smoothly. Even when streaming services distribute content across multiple servers, the underlying network architecture depends on these precise calculations to route your requests efficiently. Without proper subnet sizing, modern digital life would grind to a halt from either address shortages or chaotic network traffic.
Worked example
/24 gives 254 usable hosts and mask 255.255.255.0.
FAQ
Why subtract 2?
The first address is the network ID and the last is the broadcast address.