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.
The Simple Formula
Usable Hosts = 2(32 - CIDR) - 2
Here's why we subtract 2:
- One address is the network address (first IP)
- One address is the broadcast address (last IP)
Reference Table
| 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 |
Quick Memory Trick
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 |
💡 Pattern: Going from /24 to /30, the hosts go: 254 → 126 → 62 → 30 → 14 → 6 → 2. Each step roughly halves the count (minus 2).
Practical Examples
Home Network
Typical home has 10-20 devices. Use /24 (254 hosts) - plenty of room!
Small Office
50 employees with computers and phones. Use /26 (62 hosts) - fits with room to grow.
Warehouse IoT
50 sensors, scanners, cameras. Use /26 or split into /27 (30 hosts each).
Point-to-Point Link
Router-to-router connection. Use /30 (2 hosts only).
Data Center
500 servers. Use /23 (510 hosts).
Planning for Growth
Always give yourself buffer. If you need 50 hosts today:
- /26 gives you 62 (tight but workable)
- /25 gives you 126 (better breathing room)
Better to allocate slightly larger subnets now than rush to reconfigure later.