Every subnet loses exactly two usable addresses to its own network and broadcast address, except the two prefix lengths where that rule doesn’t apply.
Free developer tool
IP Subnet Calculator
Network and broadcast address, usable host range, binary breakdown, and IP class, from any IPv4 address and subnet mask.
Runs entirely in your browser. Nothing you enter is sent anywhere.
Network, broadcast, and the two addresses you lose
Every subnet reserves its first address for the network itself and its last for the broadcast address, neither is assignable to a device, which is why a /24 with 256 total addresses only offers 254 usable ones. The exceptions are /31 (a point-to-point link, where RFC 3021 lets both addresses be used as hosts since there's no room for a separate broadcast address) and /32 (a single host route with exactly one address and no network/broadcast concept at all). This calculator applies both exceptions rather than always subtracting two.
IP subnet calculator FAQ
How do I calculate the network and broadcast address?
The network address is the IP address bitwise-ANDed with the subnet mask, and the broadcast address is the network address bitwise-ORed with the wildcard mask (the inverse of the subnet mask). For 192.168.1.10/24, the network address is 192.168.1.0 and the broadcast address is 192.168.1.255.
Why does a /24 only have 254 usable hosts, not 256?
The first address in any subnet (the network address) and the last (the broadcast address) are both reserved and can't be assigned to a device, so a /24's 256 total addresses become 254 usable ones. The two exceptions are /31, a point-to-point link where RFC 3021 allows both addresses to be used as hosts, and /32, a single-host route with no network or broadcast concept at all.
What is a wildcard mask?
The bitwise inverse of the subnet mask, used mainly in Cisco access-control-list syntax and OSPF configuration. Where the subnet mask has a 1, the wildcard mask has a 0, and vice versa, so a /24's subnet mask 255.255.255.0 has the wildcard mask 0.0.0.255.
What do IP classes A, B and C actually mean today?
They're a legacy pre-1993 addressing scheme (Class A: first octet 1-126, Class B: 128-191, Class C: 192-223) from before CIDR notation existed. Modern networks use CIDR prefixes exclusively and largely ignore class boundaries, but the class is still commonly asked about and shown here for reference.
Which IP ranges are private, not internet-routable?
The three RFC 1918 blocks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16, plus 127.0.0.0/8 (loopback) and 169.254.0.0/16 (link-local/APIPA). Anything outside those ranges is potentially routable on the public internet.
Is my IP address sent anywhere?
No. Every calculation runs in your browser using plain arithmetic. Nothing you enter is sent to a server, logged, or stored.
Free IP subnet calculator by ANUPRESS
Network and broadcast aren’t assignable, and that’s the whole trick
A /24 has 256 total addresses but only 254 usable ones, because the first address in the range always identifies the subnet itself and the last always means “everyone on this subnet.” Neither can be handed to a single device. Once you internalize that one rule, sizing any subnet becomes arithmetic: usable hosts is always 2 to the power of the host bits, minus 2.
The two prefix lengths that break the rule on purpose
/31 exists specifically for point-to-point links, a router-to-router connection with exactly two devices and no need for a broadcast address, so RFC 3021 lets both addresses in a /31 be used as real hosts. /32 goes further and represents a single address with no concept of network or broadcast at all, used for loopback interfaces and individual host routes. This calculator applies both exceptions automatically rather than blindly subtracting two from every result.
Reading the binary is worth the extra thirty seconds
The binary breakdown shown alongside the decimal result is where subnetting actually clicks for most people: the subnet mask’s run of 1s marks exactly which bits identify the network, and everything after it is host-addressable space. Once that’s visible in binary rather than abstracted into a formula, questions like “why does a /25 split a /24 exactly in half” answer themselves.