HOST CAPACITY REFERENCE
The shortest answer is a formula: an IPv4 prefix leaves 32 minus the prefix length as host bits, and those bits define the size of the address block. The useful answer is slightly more careful. Total addresses and usable host addresses are not always the same thing, and /31 and /32 do not fit the old subtract-two shortcut.
When you are planning a VLAN, point-to-point link, loopback, transit network, or VLSM allocation, the practical question is not just “how many IPs are in /26?” It is “how many addresses does the prefix contain, how many can this design actually use, and is this the smallest prefix that fits the requirement?”
Quick answer: for ordinary IPv4 LAN-style subnets from /0 through /30, traditional usable hosts = 2(32 − prefix) − 2. For /31 and /32, handle the prefix according to its actual use rather than forcing that formula.
Exception: do not apply the subtract-two rule blindly to /31 and /32.
Common IPv4 host counts
| CIDR | Subnet mask | Total addresses | Traditional usable / special |
|---|---|---|---|
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 endpoints* |
| /32 | 255.255.255.255 | 1 | 1 address* |
From prefix length to host capacity
IPv4 addresses contain 32 bits. A CIDR prefix tells you how many of those bits belong to the network portion. The remainder is the host portion. If a subnet is /24, eight bits remain. If it is /27, five bits remain. If it is /30, only two bits remain.
The total address count is therefore 2 raised to the number of host bits. A /24 has 28 = 256 addresses. A /27 has 25 = 32. A /30 has 22 = 4.
For the traditional network-and-broadcast model, one address identifies the network and one is the directed broadcast address. That produces the familiar usable-host count of total minus two. This convention works for the usual LAN-style prefixes through /30, but it is not a universal law that should be applied to every IPv4 prefix.
| Prefix | Host bits | Total addresses | Traditional usable / special |
|---|---|---|---|
| /24 | 8 | 256 | 254 |
| /25 | 7 | 128 | 126 |
| /26 | 6 | 64 | 62 |
| /27 | 5 | 32 | 30 |
| /28 | 4 | 16 | 14 |
| /29 | 3 | 8 | 6 |
| /30 | 2 | 4 | 2 |
| /31 | 1 | 2 | 2 endpoints* |
| /32 | 0 | 1 | 1 address* |
Do not force the old formula: a calculation that produces 0 usable addresses for /31 or −1 for /32 is a sign that the formula has been pushed past the context where it applies.
Why total addresses and usable hosts differ
A subnet can contain a certain number of addresses without making every address assignable to an ordinary host. In the traditional model, the all-zero host portion identifies the network and the all-one host portion is the directed broadcast address. That is why a /26 contains 64 addresses but is normally described as supporting 62 usable hosts.
Operational platforms can reserve additional addresses for their own purposes. Cloud providers are a common example. The CIDR math does not change, but the platform-specific usable capacity may be smaller than pure IPv4 arithmetic suggests. For planning, separate “addresses in the prefix” from “addresses the platform lets me assign.”
Worked examples
How many hosts are in a /24?
A /24 leaves 8 host bits. That gives 28 = 256 total IPv4 addresses. Under the traditional LAN model, 254 are usable host addresses.
For 192.168.50.0/24, the network address is 192.168.50.0 and the broadcast address is 192.168.50.255. The conventional usable range is 192.168.50.1 through 192.168.50.254.
How many hosts are in a /26?
A /26 leaves 6 host bits, so it contains 64 total addresses and 62 traditional usable hosts. The fourth-octet block size is 64, which creates subnet boundaries at 0, 64, 128, and 192.
Network: 192.168.10.64/26
Broadcast: 192.168.10.127
Usable: 192.168.10.65 - 192.168.10.126
64 total addresses; 62 traditional usable hosts.
For 192.168.10.77/26, the containing network is 192.168.10.64/26. The broadcast address is 192.168.10.127, and the conventional usable host range is 192.168.10.65 through 192.168.10.126.
How many hosts are in a /27?
A /27 leaves 5 host bits. It therefore contains 32 total addresses and 30 traditional usable hosts. Its fourth-octet boundaries occur every 32 values: 0, 32, 64, 96, 128, 160, 192, and 224.
If an interface is 10.20.30.118/27, 118 falls inside the 96–127 block. The network is 10.20.30.96/27, the broadcast is 10.20.30.127, and the traditional usable range is 10.20.30.97 through 10.20.30.126.
How many hosts are in a /30?
A /30 contains four addresses and, under the traditional model, two usable host addresses. That is why /30 was historically common for numbered point-to-point links: one network address, two interface addresses, and one broadcast address.
/31 and /32 are special cases
The old host-count shortcut becomes misleading at the two longest IPv4 prefixes. A /31 has two total addresses. On a routed point-to-point link that supports RFC 3021, both addresses can be used as endpoints; there is no conventional network-and-directed-broadcast pair consuming the block.
/30
/31 (RFC 3021)
A /32 is a single IPv4 address. It is commonly used as a host route or loopback prefix. There is no address range to divide into network, host, and broadcast roles. Treating a /32 as “minus two” is not useful subnet planning.
Operational distinction: use /31 where the link type and both endpoints support RFC 3021 semantics. Use /32 when you need to identify exactly one address, such as a loopback or host route. Do not choose either prefix just because a host-count table makes it look efficient.
What /31 saves compared with /30
Each traditional /30 consumes four addresses for a two-endpoint link. A /31 consumes two. Across a large routed infrastructure, that difference can materially reduce address consumption. The savings matter most where many numbered point-to-point links are deployed.
Choose a prefix from the host requirement
When the requirement starts as a host count rather than a prefix, work in the opposite direction: find the smallest traditional subnet whose usable capacity meets or exceeds the requirement. This is the core sizing step behind VLSM — different requirements receive different prefix sizes, normally allocated largest first, without changing the underlying host-count formula.
| Required usable hosts | Smallest traditional prefix | Total addresses | Traditional usable |
|---|---|---|---|
| 2 | /30 | 4 | 2 |
| 6 | /29 | 8 | 6 |
| 14 | /28 | 16 | 14 |
| 30 | /27 | 32 | 30 |
| 62 | /26 | 64 | 62 |
| 126 | /25 | 128 | 126 |
| 254 | /24 | 256 | 254 |
| 510 | /23 | 512 | 510 |
| 1,022 | /22 | 1,024 | 1,022 |
| 2,046 | /21 | 2,048 | 2,046 |
| 4,094 | /20 | 4,096 | 4,094 |
The table answers capacity, not architecture. A requirement for 200 devices fits in a /24 mathematically, but the correct design still depends on broadcast-domain size, growth, security boundaries, failure domains, DHCP reservations, infrastructure addresses, and platform-specific reservations.
Avoid the two extremes: do not size so tightly that routine growth immediately forces renumbering. Do not solve that problem by giving every small segment a huge subnet. Headroom should be deliberate and documented.
A fast way to answer host-count questions
When you see a prefix such as /23, /26, or /29, you can answer the capacity question in three steps.
- Subtract the prefix from 32 to get the host-bit count. For /26, 32 − 26 = 6.
- Raise 2 to that number of bits. Six host bits give 64 total addresses.
- For a traditional subnet through /30, subtract two. A /26 therefore supports 62 traditional usable hosts.
With practice, the common values become easier to recognize as a doubling ladder: /30 = 2 usable, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126, /24 = 254, /23 = 510, and /22 = 1,022.
| Prefix | Traditional usable hosts |
|---|---|
| /30 | 2 |
| /29 | 6 |
| /28 | 14 |
| /27 | 30 |
| /26 | 62 |
| /25 | 126 |
| /24 | 254 |
| /23 | 510 |
| /22 | 1,022 |
| /21 | 2,046 |
| /20 | 4,094 |
Do not confuse host count with subnet count
“How many hosts are in /26?” and “how many /26 subnets fit inside /24?” are different questions. A /26 contains 64 addresses and 62 traditional usable hosts. A /24 can be split into four /26 subnets because the prefix grows by two bits, producing 22 = 4 child prefixes.
That distinction matters in VLSM work. Host capacity is controlled by the host bits inside each prefix. The number of child subnets is controlled by how many bits you borrow from the parent network.
Do not confuse one interface with one subnet
An interface address such as 172.16.8.37/27 tells you which /27 subnet the interface belongs to; it does not mean the network starts at .37. The network boundary still comes from the prefix. For /27, the block size is 32, so .37 falls in the .32–.63 block and the network is 172.16.8.32/27.
What changes with IPv6?
IPv6 also uses CIDR-style prefix lengths, but the familiar IPv4 usable-host shortcut does not carry over. IPv6 has no broadcast address, and IPv6 subnet design is normally based on architecture and address-plan conventions rather than trying to conserve individual interface addresses. A /64 is the standard size for most ordinary IPv6 LAN segments, even though its theoretical address space is enormous. For IPv6 planning, use the dedicated IPv6 Subnetting Tools guide rather than applying an IPv4 host-count table to a 128-bit address space.
FAQ
How many hosts are in a /24 subnet?
A /24 contains 256 total IPv4 addresses and 254 traditional usable host addresses.
How many hosts are in a /26?
A /26 contains 64 total addresses and 62 traditional usable hosts.
How many hosts are in a /27?
A /27 contains 32 total addresses and 30 traditional usable hosts.
How many hosts are in a /30?
A traditional /30 contains four addresses and provides two usable host addresses.
Does a /31 have zero usable hosts?
Not on a supported routed point-to-point link. RFC 3021 allows both addresses in a /31 to serve as endpoints, so a /31 can number a two-endpoint link without the network and broadcast overhead of a /30.
What does /32 mean?
A /32 identifies one IPv4 address. It is commonly used for host routes and loopbacks rather than as a conventional multi-host subnet.
What subnet should I use for 100 hosts?
A /25 provides 126 traditional usable host addresses, so it is the smallest conventional IPv4 prefix that fits 100 hosts. You may choose a larger subnet if the design requires additional growth or reserved capacity.
Use host count as part of the larger subnet decision
Host capacity is one input into subnet design. Once you know how many endpoints must fit, you still need the actual network boundary, address range, overlap status, and sometimes a VLSM or summarization plan. The IPRevealed tools are designed to separate those jobs instead of forcing one calculator to hide the reasoning.
| Task | Resource |
|---|---|
| Full IPv4 subnetting method, worked examples, VLSM, overlap, and summarization | IPv4 Subnetting Guide |
| Understand prefixes, masks, ranges, and CIDR boundaries | CIDR Notation Explained |
| Fast prefix-to-mask, wildcard, and capacity reference | Subnet Mask Cheat Sheet |
| Calculate network, broadcast, usable range, and host capacity from an IPv4 prefix | Subnet Calculator |
| Allocate multiple host requirements efficiently inside a parent network | VLSM Calculator |
| Split a larger prefix into equal smaller subnets | Subnet Splitter |
| Convert between CIDR blocks and explicit IP ranges | CIDR & IP Range Converter |
| Verify whether two address blocks intersect | Subnet Overlap Checker |
RFC 3021, “Using 31-Bit Prefixes on IPv4 Point-to-Point Links,” defines the /31 point-to-point behavior discussed in this guide. The traditional network/broadcast host-count model remains useful for ordinary IPv4 subnets, but operational software and cloud platforms can reserve additional addresses beyond the arithmetic shown here.
Field check: before assigning a prefix, answer three questions. How many total addresses does it contain? How many addresses are actually usable in this environment? Is it the smallest prefix that fits the requirement with deliberate headroom?