How it works
An IPv4 address is 32 bits. The prefix length says how many leading bits name the network; the rest name hosts inside it. Setting the host bits to zero gives the network address, setting them to ones gives the broadcast address, and the addresses between them (excluding those two) are usable by devices. The mask is the prefix written as four octets.
Formula
Network = address with host bits cleared.
Broadcast = network + size − 1.
Usable hosts = size − 2 (all but network and broadcast).
Example
Example in plain words. 192.168.1.10 with prefix /24.
Size: 2^(32 − 24) = 256 addresses.
Network: 192.168.1.0, broadcast: 192.168.1.255, mask: 255.255.255.0.
Usable: 254 hosts, from 192.168.1.1 to 192.168.1.254.
Frequently asked questions
What are /31 and /32?
A /32 names one single address. A /31 has just two addresses and is used for point-to-point links, where the broadcast reservation does not apply; the calculator shows the full size for these.
Is my address private?
Ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private and never routed on the public internet.