What is CIDR?
CIDR (Classless Inter-Domain Routing, pronounced “cider”) is the standard way to describe an IP network by its address and prefix length. A CIDR block such as 203.0.113.0/24 means “the 256 addresses that share the first 24 bits with 203.0.113.0”. Before CIDR, addresses were handed out in fixed class A, B and C sizes, which wasted huge amounts of space. CIDR lets providers and administrators allocate exactly the size they need, and lets routers aggregate many routes into one — the reason the global routing table is manageable today.
CIDR notation explained
In CIDR notation the number after the slash is the prefix length: how many of the 32 bits belong to the network. The remaining bits are the host part. A larger prefix number means a smaller network: /30 has 4 addresses, /24 has 256 and /16 has 65,536.
192.168.10.0/26
prefix length = 26 → 26 network bits, 6 host bits
subnet mask = 255.255.255.192
total addresses= 2^6 = 64
usable hosts = 64 − 2 = 62
range = 192.168.10.0 – 192.168.10.63CIDR calculation formula
- Total addresses = 2(32 − prefix)
- Usable hosts = 2(32 − prefix) − 2 (network and broadcast addresses)
- Block size in the “interesting” octet = 256 − the mask value in that octet
- Network address = IP address AND subnet mask
- Broadcast address = network address OR wildcard mask
CIDR to subnet mask conversion table
| CIDR | Subnet mask | Wildcard | Addresses |
|---|---|---|---|
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 |
The complete list from /0 to /32 is on the subnet mask cheat sheet.
CIDR vs classful addressing
Classful addressing fixed the network size by the first octet: class A was always /8, class B /16 and class C /24. CIDR removed that link, so a company that needed 2,000 addresses could receive a /21 instead of a whole class B. See IP address classes for the old ranges and VLSM vs CIDR for how the two ideas fit together.
CIDR for AWS, Azure and Google Cloud
Cloud networks are defined with CIDR blocks. Choose a private RFC 1918 range for each VPC or VNet, keep ranges unique across every network you may connect, and leave room to grow — a /16 VPC split into /24 subnets gives you 256 subnets per VPC. Remember that clouds reserve a few addresses in each subnet (AWS reserves five), so a /28 subnet gives 11 usable addresses there, not 14. Use the calculator above to check a block before you create it.