InfyCalculator
💻

Subnet Host Count Calculator

Find how many total and usable IPv4 addresses a subnet prefix provides, plus its mask.

Prefix length (/n)
Loading calculator…

How it works

Total = 2^(32 − prefix); usable = total − 2 (network + broadcast)

The prefix length says how many bits are fixed for the network, leaving the rest for hosts. Two addresses are reserved — the network and broadcast — so usable hosts are total minus two (except tiny /31 and /32).

Worked example

A /24 has 2^8 = 256 addresses and 254 usable hosts, mask 255.255.255.0.

Frequently asked questions

Why subtract two?

The first address identifies the network and the last is the broadcast address, so neither can be assigned to a host.

What about /31?

A /31 is a special case for point-to-point links where both addresses are usable (RFC 3021).

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.