Subnetting divides an IP address into a network portion and a host portion. The prefix length says how many leading bits identify the network, which fixes the network address, the broadcast address and exactly how many hosts fit inside.
How CIDR notation works
In 192.168.10.0/24 the /24 means the first 24 bits identify the network, leaving 8 bits for hosts. That gives 2⁸ = 256 addresses, of which 254 are usable.
Two addresses in every ordinary subnet are reserved: the all-zeros host address identifies the network itself, and the all-ones address is the broadcast.
Total addresses = 2^(32 − prefix) Usable hosts = 2^(32 − prefix) − 2
Common subnet sizes
| CIDR | Subnet mask | Total | Usable hosts |
|---|---|---|---|
| /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 is a special case defined in RFC 3021 for point-to-point links, where both addresses are usable. /32 identifies a single host.
Private address ranges
RFC 1918 reserves three blocks that are never routed on the public internet:
| Range | CIDR | Addresses |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 |
Why subnet at all
- Broadcast containment — broadcast traffic stays inside its subnet, so smaller subnets mean less noise.
- Security segmentation — traffic between subnets passes a router or firewall where policy can be applied.
- Address efficiency — a point-to-point link needs two addresses, not 254.
- Organisation — mapping subnets to departments, sites or VLANs makes networks legible and troubleshooting faster.
Worked example
Using the values pre-loaded in the calculator above:
| Input | Value |
|---|---|
| IP address | 192.168.10.37 |
| Prefix length (CIDR) | 26 |
| Output | Value |
|---|---|
| Network | 192.168.10.0/26 |
| Subnet mask | 255.255.255.192 |
| Wildcard mask | 0.0.0.63 |
| Network address | 192.168.10.0 |
| Broadcast address | 192.168.10.63 |
| First usable host | 192.168.10.1 |
| Last usable host | 192.168.10.62 |
| Total addresses | 64 |
Frequently asked questions
Why are two addresses unusable in each subnet?
The first identifies the network itself and the last is the broadcast address for that network. Neither can be assigned to a host, except in /31 point-to-point links.
What is the difference between a subnet mask and CIDR?
They express the same thing. 255.255.255.0 and /24 both mean 24 network bits — CIDR is just the compact form.
How do I pick a prefix length?
Count the hosts you need, add headroom, then choose the smallest subnet that fits. Twenty hosts needs a /27 (30 usable); sixty needs a /26 (62 usable).
What is a wildcard mask?
The bitwise inverse of the subnet mask, used in Cisco access control lists and OSPF. The inverse of 255.255.255.0 is 0.0.0.255.