Usable Hosts Calculator
Calculate number of usable host addresses in a subnet
Input CIDR Addresses
Usable hosts = Total - 2 (network & broadcast), except /31 (2 usable) and /32 (1 usable).
Usable Host Counts
Usable host counts will appear here
The Usable Hosts Calculator determines how many IP addresses in a subnet can actually be assigned to devices, excluding the reserved network and broadcast addresses. Enter a CIDR prefix length like /24 to instantly see the usable host count for planning DHCP scopes, capacity, and IP allocation.
Understanding Usable Host Counts
The usable host count is the number that matters most when you are sizing a subnet for real-world use. It answers the practical question: "how many devices can I put on this subnet?" The answer is always two fewer than the total address count, because every standard IPv4 subnet reserves the first address (the network address) and the last address (the broadcast address). Neither can be assigned to a host.
For large subnets, this two-address overhead is negligible. A /24 has 256 total addresses and 254 usable -- you barely notice the difference. But for small subnets, the overhead is significant. A /30 has only 4 total addresses and 2 usable, meaning 50% of the space is reserved. A /29 has 8 total and 6 usable. These small subnets are common for WAN links, DMZ segments, and other scenarios where only a handful of devices need addresses, and choosing the wrong prefix length by even one bit can mean the difference between having enough addresses and falling short.
The calculation is straightforward: 2^(host bits) - 2. But in practice, you also need to account for addresses consumed by infrastructure -- the default gateway, any HSRP/VRRP virtual IPs, management interfaces on switches and access points, and addresses reserved for future use. The true capacity of a subnet for end-user devices is the usable host count minus all these infrastructure reservations, which is why experienced network planners always build in headroom rather than sizing to the exact device count.
How to Calculate Usable Hosts in a Subnet
- Enter a prefix length (e.g.,
/24) or a full CIDR block (e.g.,192.168.1.0/24) - The calculator computes the number of host bits: 32 - prefix length (for IPv4)
- The formula 2^(host bits) - 2 is applied to subtract the network and broadcast addresses
- The result is the number of addresses available for assignment to hosts
Usable Host Count by Prefix Length
| Prefix | Total Addresses | Usable Hosts | Formula | Common Use |
|---|---|---|---|---|
/8 | 16,777,216 | 16,777,214 | 2^24 - 2 | Large enterprise block |
/16 | 65,536 | 65,534 | 2^16 - 2 | Campus / site allocation |
/20 | 4,096 | 4,094 | 2^12 - 2 | Large VLAN |
/21 | 2,048 | 2,046 | 2^11 - 2 | Medium VLAN |
/22 | 1,024 | 1,022 | 2^10 - 2 | Medium VLAN |
/23 | 512 | 510 | 2^9 - 2 | Extended LAN |
/24 | 256 | 254 | 2^8 - 2 | Standard LAN |
/25 | 128 | 126 | 2^7 - 2 | Half LAN |
/26 | 64 | 62 | 2^6 - 2 | Small department |
/27 | 32 | 30 | 2^5 - 2 | Server cluster |
/28 | 16 | 14 | 2^4 - 2 | Small DMZ |
/29 | 8 | 6 | 2^3 - 2 | Minimal subnet |
/30 | 4 | 2 | 2^2 - 2 | Point-to-point link |
/31 | 2 | 2 | Special (RFC 3021) | Point-to-point (no waste) |
/32 | 1 | 1 | Single host | Loopback / host route |
When to Use This Tool
- Choosing the right subnet size -- find the smallest prefix that accommodates your device count with room for growth
- DHCP scope planning -- set pool boundaries based on the exact number of assignable addresses
- IP address audit -- compare usable capacity against the number of active hosts to measure utilization
- Cloud VPC design -- AWS, Azure, and GCP subnets each reserve additional addresses beyond the standard two (typically 3-5 extra)
- Exam preparation -- CCNA and CompTIA Network+ exams frequently test usable host calculations
- Budget planning -- estimate how many subnets of each size you need to cover your device count across sites
How Usable Host Counting Works
Why Subtract 2?
Every standard IPv4 subnet reserves two addresses:
Network address β 192.168.1.0 (host bits: 00000000) β cannot assign
First usable β 192.168.1.1 (host bits: 00000001) β assignable
...
Last usable β 192.168.1.254 (host bits: 11111110) β assignable
Broadcast address β 192.168.1.255 (host bits: 11111111) β cannot assign
The network address identifies the subnet in routing tables. The broadcast address is used for one-to-all communication (ARP, DHCP discovery). Neither can be assigned to a host.
Choosing the Right Prefix for Your Host Count
To determine the correct prefix length, find the smallest subnet where usable hosts >= your requirement:
| You need | Minimum prefix | Usable hosts | Headroom |
|---|---|---|---|
| 10 devices | /28 | 14 | 40% |
| 25 devices | /27 | 30 | 20% |
| 50 devices | /26 | 62 | 24% |
| 100 devices | /25 | 126 | 26% |
| 200 devices | /24 | 254 | 27% |
| 500 devices | /23 | 510 | 2% |
| 1,000 devices | /22 | 1,022 | 2.2% |
A good rule of thumb is to aim for 20-50% headroom above your current device count to accommodate growth without resubnetting.
Cloud Provider Subnet Reservations
Cloud providers reserve additional addresses beyond the standard two:
| Provider | Extra Reserved | Example for /24 | Actual Usable |
|---|---|---|---|
| AWS | 3 (router, DNS, future use) | 256 - 5 = 251 | 251 |
| Azure | 3 (router, DNS x2) | 256 - 5 = 251 | 251 |
| GCP | 2 (standard only) | 256 - 4 = 252 | 252 |
When planning cloud subnets, account for these extra reservations in addition to the standard network and broadcast addresses.
Edge Cases: /31 and /32
/31 (RFC 3021): Provides exactly 2 usable addresses with no network or broadcast reservation. Designed for point-to-point links between two routers, saving one address compared to the traditional /30.
/32: Represents a single host address. Used for loopback interfaces (interface Loopback0) and host-specific routes. The "usable" count is 1.
Sizing Subnets in Practice
The biggest mistake in subnet sizing is planning for exactly the number of devices you have today. Networks grow. A department that has 45 workstations today will have 50 next quarter after hiring, plus a new printer, a conference room display, and a couple of IoT sensors. If you chose a /26 (62 usable hosts) based on 45 devices, you have just enough room -- but one unexpected growth spurt forces a disruptive re-addressing project. A /25 (126 usable hosts) costs you nothing extra in a private address space and gives you years of growth runway.
The exception to this guideline is small, purpose-built subnets. A /30 or /31 for a WAN link should be exactly that size -- there will never be more than two devices on the link. A /28 for a DMZ with 4 servers and a firewall interface is appropriately sized because DMZ segments are tightly controlled and you do not want unused address space that could be exploited. In security-sensitive segments, right-sizing the subnet limits the number of addresses that could potentially be assigned to rogue devices.
When working in cloud environments, always verify the provider's subnet reservations before sizing. A /28 in standard IPv4 gives you 14 usable hosts, but in AWS it gives you only 11 (14 minus the 3 extra reserved addresses). If you are deploying exactly 11 instances, you have zero headroom. Bumping up to a /27 (32 total, 27 usable in AWS) gives you comfortable space. Cloud subnet sizing requires the same headroom thinking as on-premises, but with the additional overhead of provider reservations factored in.
Frequently Asked Questions
How many usable hosts are in a /24?
A /24 subnet has 8 host bits, giving 2^8 = 256 total addresses. Subtracting the network address and broadcast address leaves 254 usable host addresses. This is the most common subnet size for office LANs and VLANs.
What is the smallest subnet that supports 50 hosts?
You need a /26, which provides 62 usable hosts (2^6 - 2). A /27 only provides 30, which is insufficient. The /26 gives 24% headroom above 50, which is reasonable for moderate growth.
Why does a /31 have 2 usable hosts instead of 0?
RFC 3021 defines /31 as a special case for point-to-point links. Since broadcast is unnecessary between exactly two devices, the standard network and broadcast reservations are waived. Both addresses in the 2-address space are assigned to the link endpoints, saving one address compared to a traditional /30.
How do usable hosts differ between IPv4 and IPv6?
The formula is the same, but the scale is vastly different. An IPv4 /24 gives 254 usable hosts, while an IPv6 /64 gives approximately 18.4 quintillion. In IPv6, address capacity per subnet is effectively unlimited, so the usable host calculation is mainly relevant for IPv4 planning.
How do I account for infrastructure devices when sizing a subnet?
Start with your end-user device count, add infrastructure (gateway, switches, APs, printers, management IPs), add 20-50% growth headroom, then pick the smallest prefix that covers the total. For example: 80 workstations + 15 infrastructure devices + 30% growth = approximately 124 addresses needed, so a /25 (126 usable) fits tightly but a /24 (254 usable) gives comfortable room.
Related Tools
- Total Hosts Calculator - Calculate total number of addresses in a subnet (IPv4/IPv6)
- IPv4 Subnet Calculator - Calculate network, broadcast, and host range from CIDR notation
- First/Last Usable Host Calculator - Find the first and last usable host addresses in a subnet
- Netmask β CIDR Converter - Convert between subnet mask notation and CIDR prefix length
- Broadcast Address Calculator - Find the broadcast address for any subnet
- VLSM Calculator - Calculate Variable Length Subnet Masks for efficient address allocation