How subnetting works
An IPv4 address has 32 bits. A subnet splits those bits into a network part and a host part. The CIDR prefix (e.g. /24) says how many leading bits belong to the network. The remaining bits address individual hosts within that network.
Key terms
- Network address: the first address; identifies the subnet itself.
- Broadcast address: the last address; reaches all hosts on the subnet.
- Subnet mask: the dotted-decimal form of the prefix (e.g.
255.255.255.0 for /24). - Wildcard mask: the inverse of the mask, used in ACLs and routing.
- Usable hosts: total addresses minus the network and broadcast addresses.
Common subnet sizes
| CIDR | Mask | Usable hosts |
|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /30 | 255.255.255.252 | 2 |
Need your own network details? Find your router IP and public IP address.
Frequently asked questions
What is a subnet calculator?
It takes an IP address and a CIDR prefix (like /24) and works out the network address, broadcast address, subnet mask, usable host range and total hosts, so you don't have to do the binary math yourself.
What does the /24 (CIDR) mean?
The number after the slash is how many bits are fixed for the network. /24 means the first 24 bits are the network and the last 8 identify hosts, giving 256 addresses (254 usable).
Why are there two fewer usable hosts than total?
In a normal subnet the first address is the network identifier and the last is the broadcast address, so they can't be assigned to devices. /31 and /32 are special cases used for point-to-point links and single hosts.
What's the difference between a public and private IP here?
Private ranges (10.x, 172.16–31.x, 192.168.x) are used inside local networks and aren't routable on the internet. The calculator flags whether your input falls in a private range.