Work out usable hosts in a subnet instantly with clear inputs, formula shown and shareable results.
A subnet reserves the all-zeros host pattern for the network address and the all-ones pattern for the broadcast address, so an IPv4 subnet with h host bits offers 2^h - 2 addresses you can assign to interfaces. Two exceptions matter in practice: an RFC 3021 /31 on a routed point-to-point link uses both addresses, and a /32 is a single host route with no broadcast at all.
Usable hosts
host bits h = 32 - prefix; usable = 2^h - reserved
The lowest address in the block identifies the network itself and the highest is the all-hosts broadcast, so neither can be configured on an interface in a normal subnet.
Yes. RFC 3021 allows both addresses of a /31 to be used on a routed point-to-point link because there is no need for a subnet broadcast when there are only two interfaces.