IP Subnet Calculator
Calculate IPv4 network address, broadcast address, CIDR subnet mask, and usable host range.
CIDR notation works too, e.g. 10.0.4.17/22.
Subnet Details
What the slash actually means
An IPv4 address is 32 bits, and CIDR notation splits it with a slash: /24 means the first 24 bits identify the network and the remaining 8 identify hosts within it. That leaves2⁸ = 256 addresses, of which two are unusable — the all-zeros network address and the all-ones broadcast address — giving 254 usable hosts.
Each step in the prefix halves or doubles the block. A /25 is 128 addresses, a/26 is 64, a /23 is 512. The subnet mask is the same information written as dotted decimal, so /24 is 255.255.255.0. Two prefixes break the host-address rule by design: /31 is used for point-to-point links and/32 addresses a single host.
Private ranges — 10.0.0.0/8, 172.16.0.0/12 and192.168.0.0/16 — are reserved by RFC 1918 and are not routable on the public internet, which is what NAT exists to bridge. When subnetting, size blocks to need plus growth: an oversized subnet wastes address space, while an undersized one requires renumbering, which is far more disruptive than leaving headroom.
Frequently asked questions
What is a CIDR subnet mask?
CIDR notation specifies the number of leading 1-bits in the subnet mask (e.g. /24 equals 255.255.255.0).
How does CIDR notation work?
The suffix gives the number of leading bits fixed as the network portion. A /24 fixes 24 bits, leaving 8 host bits, so 256 addresses of which 254 are usable. Each step down doubles the block: /23 is 512 addresses, /22 is 1,024.
Why are two addresses unusable in a subnet?
The all-zeros host address identifies the network itself and the all-ones address is the directed broadcast, so neither can be assigned to a host. That is why a /24 offers 254 usable addresses rather than 256. A /31 is the special case, defined by RFC 3021 for point-to-point links, where both addresses are usable.
Which address ranges are private?
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private use. RFC 6598 adds 100.64.0.0/10 for carrier-grade NAT, and 169.254.0.0/16 is link-local for automatic addressing when DHCP fails. None of these are routable on the public internet.