IPv4 tool
Subnet calculator
Enter an IPv4 address with a prefix or subnet mask to get its network and broadcast addresses, usable host range, wildcard mask and host count. Unlike most subnet calculators, it also shows the working, so you can check the method you will need in an exam.
For example 10.20.30.40/20 or 10.20.30.40 255.255.240.0.
| Network address | 192.168.10.64/27 |
|---|---|
| Broadcast address | 192.168.10.95 |
| Usable host range | 192.168.10.65 – 192.168.10.94 |
| Subnet mask | 255.255.255.224 |
| Wildcard mask | 0.0.0.31 |
| Total addresses | 32 |
| Usable hosts | 30 |
| Usable in an AWS VPC subnet | 27 |
| Address type | Private (RFC 1918, 192.168.0.0/16) |
How it is worked out
- /27 means a mask of 255.255.255.224.
- The interesting octet is the fourth one, where the mask is 224. Block size = 256 − 224 = 32.
- Subnets in that octet start at multiples of 32. 77 falls in the block from 64 to 95.
- Network address = 192.168.10.64; broadcast = the next block minus one = 192.168.10.95.
- Usable hosts run from the network plus one to the broadcast minus one: 192.168.10.65 to 192.168.10.94, which is 2^5 − 2 = 30 addresses.
Worked examples
One example for each place a mask can stop, plus a point-to-point /31. The block size is 256 minus the mask value in the octet where the mask stops being 255.
| Address | Mask | Network | Broadcast | Usable range | Hosts |
|---|---|---|---|---|---|
| 10.4.200.19/12 | 255.240.0.0 | 10.0.0.0 | 10.15.255.255 | 10.0.0.1 – 10.15.255.254 | 1,048,574 |
| 172.16.45.9/20 | 255.255.240.0 | 172.16.32.0 | 172.16.47.255 | 172.16.32.1 – 172.16.47.254 | 4,094 |
| 192.168.10.77/27 | 255.255.255.224 | 192.168.10.64 | 192.168.10.95 | 192.168.10.65 – 192.168.10.94 | 30 |
| 10.0.0.6/30 | 255.255.255.252 | 10.0.0.4 | 10.0.0.7 | 10.0.0.5 – 10.0.0.6 | 2 |
| 10.255.0.1/31 | 255.255.255.254 | 10.255.0.0 | — | 10.255.0.0 – 10.255.0.1 | 2 |
Wildcard masks
The wildcard mask is the subnet mask inverted: subtract each octet from 255. Cisco IOS reads it bit by bit, where 0 means the address bit must match and 1 means ignore it.
| Prefix | Subnet mask | Wildcard mask |
|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 |
| /16 | 255.255.0.0 | 0.0.255.255 |
| /20 | 255.255.240.0 | 0.0.15.255 |
| /22 | 255.255.252.0 | 0.0.3.255 |
| /24 | 255.255.255.0 | 0.0.0.255 |
| /26 | 255.255.255.192 | 0.0.0.63 |
| /27 | 255.255.255.224 | 0.0.0.31 |
| /28 | 255.255.255.240 | 0.0.0.15 |
| /29 | 255.255.255.248 | 0.0.0.7 |
| /30 | 255.255.255.252 | 0.0.0.3 |