Usable Subnet Hosts
Number of usable IPv4 addresses in a subnet with an n-bit prefix.
Live Calculator
MembersVariables
Example
/24 network: H = 2⁸ - 2 = 254
How it works
An IPv4 address has 32 bits, so if a subnet uses an n-bit prefix, the remaining 32 - n bits are available for host addresses. That means the subnet contains 2^(32 - n) total address combinations, but two of them cannot be assigned to devices: the all-zeros address identifies the subnet itself, and the all-ones address is the broadcast address. Subtracting those two leaves the number of usable host addresses.
When to use it
Use this when planning or checking IPv4 subnet sizes, such as deciding how many devices fit in a network segment. It is also useful in exams, network design, and troubleshooting address allocation.
Worked example, step by step
/27 subnet H = 2^(32 - 27) - 2 H = 2^5 - 2 H = 32 - 2 H = 30 usable hosts
Common mistakes to avoid
- Forgetting to subtract 2 for the network and broadcast addresses
- Using the wrong prefix length, especially confusing /24 with /32
- Applying this formula to IPv6, where the addressing rules are different
Did You Know?
Two addresses are always reserved: one for the network itself and one for broadcast.
Share this formula
More in Telecom & Networking
View allShannon Channel Capacity
AdvancedMaximum error-free data rate of a channel given bandwidth and signal-to-noise ratio.
Nyquist Data Rate
IntermediateMaximum data rate for a noiseless channel with M signal levels.
Power Decibels
BasicRatio of two power levels expressed logarithmically.
Free-Space Path Loss
AdvancedSignal attenuation over distance in free space (d in km, f in MHz).
Throughput
BasicActual data delivered per unit time.
Propagation Delay
IntermediateTime for a signal to travel a distance at propagation speed.