Subnet Mask Calculator
Convert a prefix length to dotted decimal, or a dotted mask back to a prefix. This page does not ask for an IP address. It answers the mask question on its own, and it rejects masks whose 1 bits are not contiguous.
Why /27 is 255.255.255.224
Twenty-seven leading 1s fill the first three octets and three bits of the last. Those three bits are 128+64+32, so the last octet is 224. The remaining five bits are the host portion, which is why the block size is 32 addresses.
Host bits are 32 minus the prefix. The block size is 2 raised to that count. /27 has five host bits and 32 addresses. An ACL that matches the same block uses the inverse, wildcard 0.0.0.31, next to the network address. The mask alone does not name which network.
Questions
Yes. Type it in the mask field and leave the field. It resolves to /27 when the 1 bits are contiguous. 255.255.0.255 does not resolve, because the 1 bits are broken up.
/0 is 0.0.0.0. /32 is 255.255.255.255. Both are contiguous, so both convert.
Yes. Twenty-four leading 1 bits fill three octets. A dotted mask with a different number of leading 1s is a different prefix.
The 1 bits are not contiguous. A prefix can be written as a slash length only when every 1 is on the left and every 0 is on the right.
Sources
Reviewed 8 October 2026. The methodology page records what these labels do not cover.
Related tools
- Wildcard Mask CalculatorInvert a subnet mask into the wildcard bits an ACL checks.
- Subnet CalculatorNetwork, broadcast, mask, and usable hosts for an IPv4 address and prefix.
- CIDR CalculatorStart from CIDR notation and see the exact block it names.
- IP Range CalculatorInclusive block bounds, then the usable host range.
