One of the most common subnetting questions is: "How many devices can I fit in this subnet?" The answer is simpler than you might think.
Usable Hosts = 2(32 - CIDR) - 2
Here's why we subtract 2:
| CIDR | Subnet Mask | Total IPs | 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 | 1024 | 1022 |
| /21 | 255.255.248.0 | 2048 | 2046 |
| /20 | 255.255.240.0 | 4096 | 4094 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
Want to remember the pattern? Each step from /24 down (adding 1 to the CIDR) halves the hosts:
| CIDR | Usable Hosts |
|---|---|
| /24 | 254 |
| /25 | 126 |
| /26 | 62 |
| /27 | 30 |
| /28 | 14 |
| /29 | 6 |
| /30 | 2 |
Typical home has 10-20 devices. Use /24 (254 hosts) - plenty of room!
50 employees with computers and phones. Use /26 (62 hosts) - fits with room to grow.
50 sensors, scanners, cameras. Use /26 or split into /27 (30 hosts each).
Router-to-router connection. Use /30 (2 hosts only).
500 servers. Use /23 (510 hosts).
Always give yourself buffer. If you need 50 hosts today:
Better to allocate slightly larger subnets now than rush to reconfigure later.