IP Subnet Calculator
Network, broadcast, mask, and usable host range from an IP and prefix
Network
—
Related Calculators
Frequently Asked Questions
How do I calculate a subnet?
Convert the /prefix into a 32-bit mask (that many leading 1s). AND the IP with the mask to get the network address; OR the network with the wildcard (inverted mask) to get the broadcast. Usable hosts = 2^(32−prefix) − 2. This calculator does all of that instantly.
How many hosts are in a /24?
A /24 has 256 total addresses and 254 usable hosts (you subtract the network and broadcast addresses). A /25 has 126, a /26 has 62, a /27 has 30, and so on — each extra prefix bit halves the host count.
What are the network and broadcast addresses?
The network address is the first address in the block (all host bits 0) and names the subnet. The broadcast address is the last (all host bits 1) and reaches every host on the subnet. Neither can be assigned to a device, which is why usable hosts is total minus 2.
What is a /31 or /32?
A /32 is a single host (one address, used for loopbacks and host routes). A /31 has two addresses used for point-to-point links, where by convention both are usable (no separate network/broadcast). This calculator handles those special cases.
What is a wildcard mask?
A wildcard mask is the bitwise inverse of the subnet mask (e.g. mask 255.255.255.0 → wildcard 0.0.0.255). It is used in access control lists and routing rules to specify which bits can vary.