A CIDR prefix shows how many of the 32 IPv4 bits identify the network. As the prefix increases by one, the address block halves: /24 has 256 addresses, /25 has 128, and /26 has 64.
Key takeaways
- A larger CIDR prefix means a smaller IPv4 block.
- Traditional usable hosts equal total addresses minus network and broadcast addresses.
- /31 and /32 use special rules and should not be treated like ordinary LAN subnets.
Common CIDR prefixes and subnet masks
The table covers the ranges most often used for home, office, lab, and routed networks. Traditional usable-host counts apply to ordinary subnets from /30 and larger blocks.
| CIDR | Subnet mask | Total addresses | Traditional usable hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | Special case |
| /32 | 255.255.255.255 | 1 | Single address |
How address counts change
IPv4 contains 32 bits. Subtract the prefix length from 32 to find the number of address bits, then raise two to that power. A /27 leaves five address bits, so it contains 2⁵ or 32 total addresses.
Moving one step toward a larger prefix halves the block. Moving one step toward a smaller prefix doubles it. This relationship is useful when sizing adjacent networks.
- Total addresses = 2^(32 − prefix length)
- Traditional usable hosts = total addresses − 2
- /27 example: 2^(32 − 27) = 32 total addresses
Private IPv4 ranges
Private addresses are intended for internal networks and are not routed across the public internet. Network address translation is commonly used when private devices access the internet.
| Private block | Address range | Typical name |
|---|---|---|
| 10.0.0.0/8 | 10.0.0.0–10.255.255.255 | 10/8 |
| 172.16.0.0/12 | 172.16.0.0–172.31.255.255 | 172.16/12 |
| 192.168.0.0/16 | 192.168.0.0–192.168.255.255 | 192.168/16 |
Special cases: /31 and /32
A /31 has two addresses. On supported point-to-point links, both can represent endpoints because a separate broadcast address is unnecessary. It is not a general replacement for an ordinary two-host LAN.
A /32 represents one exact IPv4 address. It is commonly used for host routes, loopback addresses, firewall rules, and references to a single endpoint.
Check the exact network before applying it
A prefix and host address must be combined to determine the actual network address, broadcast address, and host range. Use the IPv4 subnet calculator for that final check.
- Confirm that planned subnets do not overlap.
- Reserve enough capacity for gateways and future devices.
- Verify DHCP boundaries and static-address reservations.
- Document each network using its network address and CIDR prefix.
Use the numbers
Related calculators
Common questions
Questions, answered.
What subnet mask is /24?+
/24 is 255.255.255.0. It contains 256 total addresses and traditionally 254 usable host addresses.
What subnet mask is /28?+
/28 is 255.255.255.240. It contains 16 total addresses and traditionally 14 usable host addresses.
How many usable hosts are in a /26?+
A /26 contains 64 total addresses and traditionally 62 usable host addresses.
Can I use both addresses in a /31?+
Yes on a properly supported point-to-point link. /31 is a special case and is not used like a traditional broadcast LAN.