How it works
Set the first p of 32 bits to one and the rest to zero. Convert each eight-bit group into a decimal octet. This mask separates the network bits from host bits.
Worked example
/27 has 24 full one bits followed by 11100000, giving 255.255.255.224. Its block size is 32 addresses.
Inputs, edge cases & common mistakes
/0 produces 0.0.0.0 and /32 produces 255.255.255.255. A prefix is a bit count, not the number of hosts. IPv6 uses prefix lengths directly rather than IPv4-style dotted masks.
Technical references
Reviewed 9 September 2026. Found an issue? Send a correction with a reproducible example.