CIDR Notation Explained
CIDR (Classless Inter-Domain Routing) is the modern way to describe IP address ranges. Instead of old-school classful addressing (Class A, B, C), CIDR uses a prefix length (the number after the slash) to define exactly how large a network is.
What the Slash Means
In 192.168.1.0/24, the /24 tells you that the first 24 of the 32 bits are the network portion. The remaining 8 bits are for hosts.
| CIDR | Subnet Mask | Addresses | Usable Hosts |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2* |
| /32 | 255.255.255.255 | 1 | 1* |
* /31 is used for point-to-point links (RFC 3021). /32 is a single host route.
CIDR vs. Classful Addressing
Before CIDR (pre-1993), IP addresses were divided into rigid classes:
- Class A (/8): 10.0.0.0, giving 16 million hosts. Way too large for most organizations.
- Class B (/16): 172.16.0.0, giving 65K hosts. Still too large for many.
- Class C (/24): 192.168.1.0, giving 254 hosts. Too small for some.
This was incredibly wasteful. A company needing 500 hosts would get a full Class B (65K addresses), wasting 99% of the space. CIDR replaced this with variable-length prefixes, so you can allocate exactly the right size block.
How to Read CIDR
The formula is simple:
- Total addresses = 2^(32 - prefix)
- Usable hosts = total - 2 (network address + broadcast)
Example: /26 gives 2^(32-26) = 2^6 = 64 addresses, 62 usable.
Each time you add 1 to the prefix, you halve the block:
- /24 = 256 addresses
- /25 = 128
- /26 = 64
- /27 = 32
- And so on.
Common CIDR Blocks in Practice
| Use Case | Typical CIDR | Why |
|---|---|---|
| Home network | /24 | 254 devices is plenty |
| Small office | /23 or /24 | 500 or 254 hosts |
| AWS VPC | /16 | Default VPC size |
| AWS subnet | /24 or /25 | Per-AZ subnets |
| Point-to-point link | /30 or /31 | Only 2 hosts needed |
| Loopback / host route | /32 | Single address |
Supernetting (CIDR Aggregation)
CIDR also works in reverse. You can combine multiple smaller networks into one larger supernet. This is called route aggregation and is critical for keeping the global routing table manageable.
For example, four /24 networks (192.168.0.0 through 192.168.3.0) can be aggregated into a single /22 announcement.
Try It
Use our subnet calculator to experiment with different CIDR sizes. Enter any network and prefix, then split and join to see how the addresses divide.
See the full subnet cheat sheet for every prefix from /0 to /32.