What It Is
The Usable IP Address Count Calculator tells you how many host addresses you can actually assign within an IPv4 subnet of a given prefix length (CIDR notation, such as /24 or /16). This is essential when planning subnets, sizing DHCP scopes, or estimating capacity for a network segment.
How to Use It
Enter the subnet prefix length — the number after the slash in CIDR notation (0 to 32). Press calculate and the tool returns the total addresses in the block, the number of host bits, and the count of usable addresses after reserving the network and broadcast addresses.
The Formula Explained
An IPv4 address has 32 bits. The prefix length p fixes the network portion, leaving 32 − p host bits. The total number of addresses is therefore \(2^{32 - p}\). In a standard subnet the first address is reserved as the network identifier and the last as the broadcast address, so the usable count is:
$$\text{usable} = 2^{\,32 - p} - 2$$
Note: a /31 point-to-point link (RFC 3021) and a /32 host route are special cases where the classic subtraction does not apply.
Worked Example
For a /24 subnet: host bits = 32 − 24 = 8, total = \(2^8 = 256\), and usable = 256 − 2 = 254 addresses. A /16 yields:
$$2^{16} - 2 = 65{,}534$$
usable hosts.
FAQ
Why subtract 2? One address identifies the network itself and one is the broadcast address; neither can be assigned to a host.
What about /31 subnets? RFC 3021 allows /31 to use both addresses for point-to-point links, giving 2 usable addresses.
Does this work for IPv6? No — this tool is for IPv4. IPv6 uses 128-bit addresses and different host-reservation conventions.