Skip to content

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.

CIDR prefix

30 usable hosts

11111111111111111111111111100000
/27
/8/16/24/32
Network bitsHost bits

Drag the line to flip mask bits. The result updates as it moves.

Subnet mask

255.255.255.224

CIDR /27. 27 network bits, 5 host bits.

Wildcard mask

0.0.0.31

Inverse of 255.255.255.224

Total addresses

32

30 usable hosts.

Subnet mask, binary

11111111111111111111111111100000

Wildcard mask, binary

00000000000000000000000000011111

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