How the split works
The prefix length counts the leading bits that identify the network. A /24 keeps 24 bits for the network and leaves 8 bits for hosts, which is 256 addresses.
The network address has every host bit set to zero and the broadcast address has every host bit set to one. Everything between them, excluding those two, can be assigned to a device.
Worked example
The address 192.168.1.10 with a /24 prefix gives the network 192.168.1.0, the broadcast 192.168.1.255 and the mask 255.255.255.0. The wildcard mask is 0.0.0.255, the usable range is 192.168.1.1 to 192.168.1.254, and there are 254 usable addresses.
The block holds 256 addresses in total; the two missing ones are the network and broadcast addresses.
The two short prefixes
A /31 is 2 addresses and both are usable on a point-to-point link, which is why the usual subtract-two rule does not apply. A /32 is a single host route.
This calculator handles both, and the usable count reflects the convention rather than a blanket subtraction.
Limits of this calculator
It handles IPv4 only. It does not do IPv6, variable-length subnet planning across several blocks, or route summarisation.
It does not check whether the address you entered is already a network or broadcast address, and it does not test reachability.
For another computing conversion, use the data calculator.
Inputs for the subnet calculator
First octet
The first number of the IPv4 address, from 0 to 255.
Second octet
The second number of the address.
Third octet
The third number of the address.
Fourth octet
The last number of the address.
Prefix length
The number after the slash, from 0 to 32, such as 24 in 192.168.1.10/24.
CALCULATOR QUESTIONS
Subnet calculator questions
Why are two addresses missing?
The lowest is the network address and the highest is the broadcast, so neither can be assigned to a host.
What is a wildcard mask?
The inverse of the subnet mask, used in access control lists where a 1 bit means ignore that part of the address.
Does a /31 really give two usable addresses?
Yes, on a point-to-point link. The old subtract-two rule was written before that convention was standard.
Can I enter a hostname?
No. Enter the four octets, so resolve the name first.
