Subnet Calculator
Enter an IPv4 address and a CIDR prefix (/24, /16, etc). The calculator gives you network, broadcast, host range, and binary breakdown.
How subnetting actually works
Every IPv4 address is 32 bits. A subnet mask divides those 32 bits into two parts: the network portion (left side, fixed within the subnet) and the host portion (right side, varies per device). CIDR notation is shorthand for "how many of those bits are network."
The math, demystified
Take 192.168.1.50/24. The /24 says the first 24 bits are network — that's the first three octets, 192.168.1. The last 8 bits (.50) identify the specific host on that subnet.
Two specific addresses in every subnet are reserved:
- Network address — all host bits are 0 (e.g.
192.168.1.0). This identifies the subnet itself; you can't assign it to a device. - Broadcast address — all host bits are 1 (e.g.
192.168.1.255). Sending here reaches every host on the subnet.
Everything in between is usable for hosts. So a /24 has 256 total addresses but only 254 usable host addresses.
Full CIDR ↔ subnet mask reference (/0 through /32)
Every valid IPv4 prefix length and its corresponding subnet mask. Common sizes admins actually use are highlighted in teal — the rest are mostly RIR allocations and theoretical edge cases. Click any row to load it into the calculator.
| CIDR | Subnet Mask | Total addresses | Usable hosts | Typical use |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 1 | 1 | Single host (loopback, host route) |
| /31 | 255.255.255.254 | 2 | 2 (RFC 3021) | Point-to-point link |
| /30 | 255.255.255.252 | 4 | 2 | Point-to-point router links |
| /29 | 255.255.255.248 | 8 | 6 | Small server VLAN |
| /28 | 255.255.255.240 | 16 | 14 | Office floor / printer VLAN |
| /27 | 255.255.255.224 | 32 | 30 | Mid-size department |
| /26 | 255.255.255.192 | 64 | 62 | Larger department |
| /25 | 255.255.255.128 | 128 | 126 | Half a /24 |
| /24 | 255.255.255.0 | 256 | 254 | Standard home / small office |
| /23 | 255.255.254.0 | 512 | 510 | Two /24s combined |
| /22 | 255.255.252.0 | 1,024 | 1,022 | Small ISP block / large LAN |
| /21 | 255.255.248.0 | 2,048 | 2,046 | Mid ISP allocation |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Mid-size enterprise |
| /19 | 255.255.224.0 | 8,192 | 8,190 | Large enterprise |
| /18 | 255.255.192.0 | 16,384 | 16,382 | Very large enterprise / small ISP |
| /17 | 255.255.128.0 | 32,768 | 32,766 | Half a /16 |
| /16 | 255.255.0.0 | 65,536 | 65,534 | Large enterprise / Class B |
| /15 | 255.254.0.0 | 131,072 | 131,070 | ISP allocation |
| /14 | 255.252.0.0 | 262,144 | 262,142 | ISP allocation |
| /13 | 255.248.0.0 | 524,288 | 524,286 | ISP allocation |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 | Major ISP allocation |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 | Major ISP allocation |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 | Carrier allocation |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 | Carrier allocation |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | Class A / RIR sub-allocation |
| /7 | 254.0.0.0 | 33,554,432 | 33,554,430 | RIR allocation |
| /6 | 252.0.0.0 | 67,108,864 | 67,108,862 | RIR allocation |
| /5 | 248.0.0.0 | 134,217,728 | 134,217,726 | RIR allocation |
| /4 | 240.0.0.0 | 268,435,456 | 268,435,454 | RIR allocation |
| /3 | 224.0.0.0 | 536,870,912 | 536,870,910 | Theoretical / unused |
| /2 | 192.0.0.0 | 1,073,741,824 | 1,073,741,822 | Theoretical / unused |
| /1 | 128.0.0.0 | 2,147,483,648 | 2,147,483,646 | Theoretical / half the IPv4 internet |
| /0 | 0.0.0.0 | 4,294,967,296 | — | Default route / matches everything |
Modern routers allow both addresses in a /31 to be assigned for point-to-point links — useful when you're trying not to waste IPs on inter-router connections. The calculator handles this case.