Subnetting splits a block of IP addresses into smaller networks by moving the boundary between the network and host portions of an address. This calculator does the bitwise math for you, but understanding what is happening makes network design and troubleshooting far easier.
How CIDR and subnet masks work
An IPv4 address is 32 bits, usually written as four decimal octets. A subnet mask is also 32 bits: a run of 1-bits marking the network portion, followed by 0-bits marking the host portion. CIDR notation simply counts those 1-bits — a /24 mask is 255.255.255.0, because the first 24 bits are 1.
To find the network address, the calculator ANDs the IP with the mask, clearing every host bit. To find the broadcast, it ORs the network with the wildcard mask (the inverted subnet mask), setting every host bit. The addresses in between are the usable host range.
Why you subtract 2 (and when you don't)
In a normal subnet, two addresses are reserved: the first identifies the network and the last is the broadcast address. Neither can be assigned to a device, so usable hosts = 2^(32 − prefix) − 2. A /24 has 256 addresses but only 254 usable hosts.
Two prefixes break this rule. A /31 (RFC 3021) is meant for point-to-point links where broadcast is meaningless, so both of its two addresses are usable. A /32 is a single host route — one address, no network or broadcast distinction — commonly used for loopbacks and host-specific routing.
Public vs. private ranges and address classes
RFC 1918 reserves three private ranges — 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 — that are not routable on the public internet and sit behind NAT on most home and office networks. The calculator flags whether your address is private, public, loopback (127.0.0.0/8), or link-local (169.254.0.0/16).
It also reports the legacy IP class (A–E). Classful addressing predates CIDR and no longer governs routing, but the class is still a quick sanity check and shows up in older documentation and exam questions.