CIDR and subnet-mask cheat sheet
A durable reference for IPv4 prefixes, host counts, wildcard masks and subnet planning.
Definition and scope
A durable reference for IPv4 prefixes, host counts, wildcard masks and subnet planning.
Use this reference to establish the meaning and limits of the result before changing production configuration.
How it works
CIDR /n fixes n leading network bits. In IPv4, /24 corresponds to 255.255.255.0; its wildcard is 0.0.0.255. IPv6 uses the same prefix notation but normally avoids dotted masks.
How to read it
Total IPv4 addresses equal 2^(32-n). Traditional usable-host counts subtract network and broadcast for prefixes up to /30; /31 is valid for point-to-point links and /32 identifies one address. IPv6 subnets do not use broadcast.
Correct and incorrect examples
Compare the normalized examples. Technical values are illustrative and use documentation ranges or reserved names.
/24 = 255.255.255.0 = 256 total addresses
192.0.2.129/24 → network 192.0.2.129
| Element | Role | Example |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 |
| /9 | 255.128.0.0 | 8,388,608 |
| /10 | 255.192.0.0 | 4,194,304 |
| /11 | 255.224.0.0 | 2,097,152 |
| /12 | 255.240.0.0 | 1,048,576 |
| /13 | 255.248.0.0 | 524,288 |
| /14 | 255.252.0.0 | 262,144 |
| /15 | 255.254.0.0 | 131,072 |
| /16 | 255.255.0.0 | 65,536 |
| /17 | 255.255.128.0 | 32,768 |
| /18 | 255.255.192.0 | 16,384 |
| /19 | 255.255.224.0 | 8,192 |
| /20 | 255.255.240.0 | 4,096 |
| /21 | 255.255.248.0 | 2,048 |
| /22 | 255.255.252.0 | 1,024 |
| /23 | 255.255.254.0 | 512 |
| /24 | 255.255.255.0 | 256 |
| /25 | 255.255.255.128 | 128 |
| /26 | 255.255.255.192 | 64 |
| /27 | 255.255.255.224 | 32 |
| /28 | 255.255.255.240 | 16 |
| /29 | 255.255.255.248 | 8 |
| /30 | 255.255.255.252 | 4 |
| /31 | 255.255.255.254 | 2 |
| /32 | 255.255.255.255 | 1 |
Common problems
Using a host address as if it were the network boundary, mixing mask and wildcard, and overlapping allocations create routing surprises. Large split operations can also produce impractical output.
Practical checklist
Normalize every input to its network address, reserve growth space, aggregate only adjacent aligned blocks, document exceptions for /31 and /32, and verify membership before changing ACLs.
Standards and primary references
These primary specifications define the protocol behavior. Provider documentation may add operational requirements but cannot replace the standard.