DeveloperLive results
Subnet / CIDR Hosts
Usable hosts in an IPv4 subnet.
Formula
Hosts = 2^(32 − cidr) − 2
How to use
- 1Pick the CIDR prefix.
- 2Read usable hosts, the subnet mask and total addresses.
About this calculator
Pick a CIDR prefix and this calculator returns three things you need constantly when planning a network: the usable host addresses, the subnet mask in dotted-decimal form, and the total addresses in the block. It turns the slash notation from router configs and cloud consoles into concrete numbers.
Formula explained
Total addresses = 2^(32 − CIDR). Usable hosts = Total − 2, because the first address (network) and last address (broadcast) are reserved. A /24 mask is 255.255.255.0.
Worked example
/24 → 2^(32−24) = 256 total, 254 usable hosts, mask 255.255.255.0. That is why /24 is the default for many home and office networks.
Tips & notes
- Leave headroom: sizing a subnet to today’s exact device count forces renumbering later.
- /30 is a classic point-to-point link (2 usable); /31 works for RFC 3021 point-to-point (2 hosts, no broadcast).
- Draw internal networks from the private ranges so they never route publicly.