Hosts Per Subnet Calculator
Find usable host counts from IPv4 prefix length or subnet mask, including /31 and /32 edge cases.
How many hosts fit in an IPv4 subnet?
DHCP scopes, firewall objects, and cloud security groups all depend on how many addresses a
prefix provides. Enter either a CIDR prefix length (such as /26)
or a dotted subnet mask to see total addresses, usable hosts, and the
matching mask and wildcard values.
How to use this calculator
- Choose whether you are typing a prefix (24) or a mask (255.255.255.0).
- Enter the value and read the usable host count card.
- Copy the JSON breakdown for runbooks or exam notes.
For full network and broadcast addresses from CIDR, pair this with the IPv4 IPv6 Subnet Calculator or the CIDR Calculator.
Frequently Asked Questions
Why do /31 and /32 behave differently?
Modern point-to-point links often use /31 (RFC 3021) with two usable addresses. A /32 identifies a single host, so usable hosts equals one.
Can I paste non-contiguous masks?
No. The mask must be a contiguous run of one bits followed by zeros (for example 255.255.255.128). Invalid masks return an error.
Does this tool handle IPv6?
This page focuses on IPv4 host math. Use the IPv4 IPv6 Subnet Calculator for IPv6 prefix planning.
Related Tools
Recent Visits
Finance Calc Kit
Focused calculators on Finance Calc Kit for loans, compounding investments, contractor tax estimates, and reti...
Explore Finance Calc Kit