How subnetting works
An IPv4 address is 32 bits, usually written as four numbers from 0 to 255. The prefix length splits those bits into two parts: the network portion (the first bits, shared by every device in the subnet) and the host portion (the rest, unique to each device). Masking the address with the subnet mask keeps only the network bits, which gives the network address.
The formula
network = IP AND mask
broadcast = network OR (NOT mask)
total addresses = 2^(32 − prefix), usable = total − 2
Example: 192.168.1.130/24
| Step | Result |
|---|---|
| Mask for /24 | 255.255.255.0 |
| Network: 192.168.1.130 AND 255.255.255.0 | 192.168.1.0 |
| Broadcast | 192.168.1.255 |
| Usable hosts | 192.168.1.1 – 192.168.1.254 (254) |
Common subnet sizes
| Prefix | Mask | Addresses | Usable hosts |
|---|---|---|---|
| /30 | 255.255.255.252 | 4 | 2 |
| /29 | 255.255.255.248 | 8 | 6 |
| /28 | 255.255.255.240 | 16 | 14 |
| /27 | 255.255.255.224 | 32 | 30 |
| /26 | 255.255.255.192 | 64 | 62 |
| /25 | 255.255.255.128 | 128 | 126 |
| /24 | 255.255.255.0 | 256 | 254 |
| /23 | 255.255.254.0 | 512 | 510 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
Frequently asked questions
What does /24 mean?
The number after the slash is the prefix length: how many of the 32 bits in an IPv4 address identify the network. /24 leaves 8 bits for hosts, which is 256 addresses (254 usable), with the mask 255.255.255.0.
Why are there two fewer usable hosts than addresses?
In a normal subnet the first address is the network address and the last is the broadcast address, so neither can be given to a device. A /24 has 256 addresses and 254 usable. The exceptions are /31 (two usable addresses on point-to-point links) and /32 (a single host).
What is a wildcard mask?
It's the subnet mask with every bit flipped, so 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF configurations use wildcard masks to say which bits must match.
What are private IP ranges?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for private networks (RFC 1918) and aren't routed on the internet. Home routers typically use 192.168.0.0/24 or 192.168.1.0/24.
How do I pick a subnet size?
Count the devices you need, add room to grow, then choose the smallest prefix whose usable hosts fit: /26 for up to 62 devices, /25 for 126, /24 for 254, /23 for 510.
Rates and figures last checked October 2026.
This calculator gives estimates for planning. Check current rates and product labels before you buy, list or file.