CIDR notation represents an IP address together with the number of leading bits that define the network portion, written as address/prefix-length. The prefix length (0–32 for IPv4, 0–128 for IPv6) tells routers and systems how many bits identify the network; the remaining bits identify individual hosts.
Before CIDR, IP addresses were divided into fixed classes (A, B, C), which wasted address space and didn't scale well. CIDR introduced variable-length prefixes, allowing networks to be sized exactly as needed. A /24 prefix, for example, reserves 24 bits for the network and leaves 8 bits for hosts—equivalent to the subnet mask 255.255.255.0.
Common examples:
| Notation | Network Bits | Hosts Available | Subnet Mask |
|---|---|---|---|
10.0.0.0/8 |
8 | ~16 million | 255.0.0.0 |
192.168.1.0/24 |
24 | 254 | 255.255.255.0 |
172.16.0.0/12 |
12 | ~1 million | 255.240.0.0 |
2001:db8::/32 |
32 (IPv6) | ~4 billion | (IPv6 prefix) |
CIDR enables route aggregation, where multiple adjacent networks can be summarized into one routing table entry—critical for keeping the global routing table manageable. It also powers Variable Length Subnet Masking (VLSM), letting you divide a network into subnets of different sizes.
Private address ranges like 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are all expressed in CIDR form.
WarningA
/24block contains 256 total addresses, but only 254 are usable for hosts in IPv4 (network and broadcast addresses are reserved). Point-to-point links use/31(2 addresses, both usable) and single hosts are/32. Prefix boundaries do not have to align with octets—/26or/27are perfectly valid.