Network
CIDR / Subnet Mask Converter
Quickly convert between CIDR notation and a dotted-decimal subnet mask, in either direction.
Runs entirely in your browser. Nothing you enter is sent anywhere.
Learn about CIDR notation and subnet masks
Two ways of writing the same thing
CIDR notation (/24) and a dotted-decimal subnet mask (255.255.255.0) both describe the exact same information: how many leading bits of a 32-bit address are fixed for the network. CIDR just counts those bits directly. A mask spells the same bit pattern out across four octets, with 1-bits for "network" and 0-bits for "host."
Quick reference
| CIDR | Subnet mask |
|---|---|
| /8 | 255.0.0.0 |
| /16 | 255.255.0.0 |
| /24 | 255.255.255.0 |
| /25 | 255.255.255.128 |
| /26 | 255.255.255.192 |
| /27 | 255.255.255.224 |
| /28 | 255.255.255.240 |
| /29 | 255.255.255.248 |
| /30 | 255.255.255.252 |
Common questions
Why do some tools ask for a mask and others want CIDR? It's mostly convention and age. Older networking gear and some legacy configuration formats grew up expecting a dotted mask, while virtually all modern router firmware, cloud consoles, and config files use CIDR. Both describe identical network boundaries.
What's a wildcard mask? It's the bitwise inverse of a subnet mask (so 255.255.255.0 becomes 0.0.0.255), used in some Cisco access-control-list and OSPF configurations. If you're seeing an unfamiliar mask that looks "backwards," that's usually why.
Can every mask be written as a CIDR prefix? Only if its 1-bits are contiguous from the left, which is universal practice today. A mask with gaps in the middle isn't a valid CIDR block, and is essentially never used in modern networking.