The calculator applies the subnet mask to the IP address to find the network and broadcast addresses, the first and last usable hosts, the number of usable hosts (2<sup>32−prefix</sup> − 2), the wildcard mask for ACLs and the IP class and type.
How to calculate a subnet
- Enter an IPv4 address with a prefix, such as 10.0.5.20/22.
- Read the network range and masks.
- Use the table to compare common prefix sizes.
CIDR cheat sheet
| Prefix | Netmask | Usable hosts |
|---|---|---|
| /30 | 255.255.255.252 | 2 |
| /29 | 255.255.255.248 | 6 |
| /28 | 255.255.255.240 | 14 |
| /27 | 255.255.255.224 | 30 |
| /26 | 255.255.255.192 | 62 |
| /25 | 255.255.255.128 | 126 |
| /24 | 255.255.255.0 | 254 |
| /23 | 255.255.254.0 | 510 |
| /22 | 255.255.252.0 | 1,022 |
| /16 | 255.255.0.0 | 65,534 |
Frequently asked questions
Why subtract 2 hosts?
The first address is the network address and the last is the broadcast address; neither can be assigned to a device. /31 and /32 are special cases.
Updated October 2026 · Built and tested by Sharjeel Tahir · How our tools are tested