Available Hosts per Subnet Calculator
When you carve a network into subnets, the single most important number is how many devices each subnet can actually hold. This calculator answers that directly from the CIDR prefix length. An IPv4 address is 32 bits long, so the bits left over for hosts equal 32 minus the prefix you choose. Two of every subnet's addresses are reserved: the lowest address names the network and the highest is the broadcast address, and neither can be assigned to a computer, printer or phone. The usable count is therefore 2 raised to the host bits, minus 2. A /24 yields 254 usable hosts, a /25 yields 126, and a /26 yields 62, the familiar pattern that halves each time you borrow a bit. Enter any prefix from /0 to /32 and the page shows the total addresses, the two reserved addresses and the usable host count, so you can size a LAN, plan a VLAN or split an address block with confidence. Every figure is computed deterministically from the standard formula rather than looked up in a table, so the result updates the instant you change the prefix, with the full method and a worked example shown below for verification.
Usable hosts equal two raised to the host bits, minus two: 2^(32 - prefix) - 2. For a /24 subnet the host bits are 8, giving 256 total addresses and 254 usable hosts after the network and broadcast addresses are removed.
Available hosts formula
Usable hosts = 2^(32 - prefix) - 2
host bits = 32 - prefix
total addresses = 2^(host bits)
reserved = 2 (network address + broadcast address)
The prefix length sets how many of the 32 bits identify the network. The remaining bits count hosts. Two addresses in every subnet are reserved and cannot be assigned, so the usable total is two less than the full address count.
Worked example
A /24 subnet uses 24 bits for the network, leaving 8 host bits.
- Host bits = 32 - 24 = 8
- Total addresses = 2^8 = 256
- Reserved = 2 (network address and broadcast address)
- Usable hosts = 256 - 2 = 254
A /24 subnet holds 254 usable hosts. These are the calculator's default inputs, so the result above matches the widget exactly.
Usable hosts by prefix
Each extra network bit halves the usable host count.
| Prefix | Host bits | Total | Usable |
|---|---|---|---|
| /22 | 10 | 1,024 | 1,022 |
| /23 | 9 | 512 | 510 |
| /24 | 8 | 256 | 254 |
| /25 | 7 | 128 | 126 |
| /26 | 6 | 64 | 62 |
| /30 | 2 | 4 | 2 |
IPv4 addressing and CIDR notation: US National Institute of Standards and Technology (NIST).
Available hosts calculator: frequently asked questions
How many usable hosts are in a subnet?
The number of usable hosts in an IPv4 subnet is 2 raised to the number of host bits, minus 2. The host bits equal 32 minus the prefix length. You subtract 2 because the all-zeros address is the network identifier and the all-ones address is the broadcast address, and neither can be assigned to a device.
Why subtract 2 from the host count?
Every IPv4 subnet reserves two addresses. The first address, where all host bits are zero, names the network itself. The last address, where all host bits are one, is the broadcast address used to reach every host at once. Because these two cannot be assigned to an interface, the usable count is the total address count minus 2.
What does a /24 give you?
A /24 prefix leaves 8 host bits, so the subnet holds 2^8, or 256, total addresses. Subtracting the network and broadcast addresses leaves 254 usable host addresses. This is the most common size for a small office or home LAN.
Does a /31 or /32 follow the same rule?
A /32 describes a single host route with one address, and a /31 is a special point-to-point case defined in RFC 3021 where both addresses are usable. For ordinary subnets of /30 and larger this calculator applies the standard 2^(32 - prefix) - 2 formula.
Is the result computed automatically?
Yes. The page computes the usable host count deterministically from the prefix length you enter using the standard formula. No figure is estimated or hard-coded, so changing the prefix updates the answer instantly.
Official sources
- IPv4 addressing, CIDR and subnetting guidance: US National Institute of Standards and Technology (NIST). As at 25 June 2026.
Reviewed by the CalculatorHub team, edited by James Graham, 25 June 2026. See our methodology. This is general information, not financial, tax, legal or investment advice.