Network guide
What is a subnet mask?
Reviewed 10 September 2026 · 5-minute read
An IPv4 subnet mask marks the network bits of an address. CIDR expresses the same boundary as a prefix length: 255.255.255.0 corresponds to /24.
Mask and prefix examples
| CIDR | IPv4 mask | Total addresses |
|---|---|---|
| /16 | 255.255.0.0 | 65,536 |
| /24 | 255.255.255.0 | 256 |
| /30 | 255.255.255.252 | 4 |
Total addresses are not always the same as conventionally usable host addresses; network design and special rules matter.
Finding a network boundary
A bitwise AND of an IPv4 address and its mask produces the network address. Prefix-aware tools handle this more safely than mental decimal arithmetic.
What about IPv6?
IPv6 normally uses prefix lengths such as /64 rather than dotted-decimal masks. The idea—leading network bits followed by interface or subnet bits—is similar.