CIDR Notation Explained: Complete Guide to IP Address Subnetting
Those numbers after IP addresses like 192.168.1.0/24 are CIDR notation — a compact way to express both a network address and its size in a single string. If you work with networks, cloud infrastructure, or DevOps, understanding CIDR is non-negotiable.
Why CIDR Matters
In the early 1990s, the internet was scaling faster than its addressing model could handle. Routing tables were growing unmanageably large, and the classful allocation system (Class A, B, C) was wasting enormous blocks of IP space. CIDR (Classless Inter-Domain Routing), introduced in 1993, solved both problems by:
- Allowing variable-length prefix allocation instead of fixed class sizes
- Enabling route aggregation, which dramatically shrunk routing table sizes
- Making it possible for the internet to scale to billions of connected devices
Without CIDR, the global routing table would have collapsed under its own weight years ago.
What Is CIDR Notation?
CIDR notation combines an IP address with a prefix length: IP address/prefix length
Take 192.168.1.0/24:
192.168.1.0— the network address/24— 24 bits are reserved for the network portion, leaving 8 bits for hosts
Think of it like a postal address: the network part identifies the street, the host part identifies the house number.
CIDR Notation Visualized: Network and Host Portions
The 32 bits of 192.168.1.0/24
prefix /24 → 24 network bits, 8 host bits
The /24 is simply a count of leading 1-bits in the mask. Everything left of the boundary identifies the network; everything right of it is free to number hosts.
Watch: CIDR Notation Explained Visually
The Math Behind CIDR Notation
Every IPv4 address has exactly 32 bits. With a /24 network:
- Network portion: 24 bits (fixed — identifies the network)
- Host portion: 8 bits (variable — identifies individual devices)
/24 is shorthand for the subnet mask 255.255.255.0. In binary:
11111111.11111111.11111111.00000000
The 1s represent the network portion; the 0s represent the host portion. The prefix length tells you exactly where the boundary sits.
CIDR Calculation Example: Breaking Down a /24 Network
For 192.168.1.0/24:
- Network address:
192.168.1.0— reserved, cannot be assigned to a device - Broadcast address:
192.168.1.255— reserved for broadcast traffic - Usable host range:
192.168.1.1to192.168.1.254 - Total usable addresses: 254 hosts (256 total minus 2 reserved)
This range is the foundation of most home and small office networks.
Common CIDR Blocks and Their Sizes
Pro tip: Use our CIDR Calculator to instantly calculate any CIDR block and see the full breakdown, including how it splits into smaller blocks.
| CIDR Prefix | Available Hosts | Example Network | Common Usage |
|---|---|---|---|
| /8 | 16,777,214 | 10.0.0.0/8 | Large enterprise networks |
| /16 | 65,534 | 172.16.0.0/16 | Mid-size organizations |
| /24 | 254 | 192.168.1.0/24 | Small offices, home networks |
| /30 | 2 | 10.0.0.0/30 | Point-to-point router links |
Key pattern: A larger prefix number means a smaller network. /28 is much smaller than /16 — more network bits means fewer host bits. This catches many people out at first.
Binary Representation of CIDR Notation
Here’s how 192.168.1.0/24 looks at the binary level:
| IP Component | Binary Representation | Decimal | Purpose |
|---|---|---|---|
| First Octet | 11000000 | 192 | Network |
| Second Octet | 10101000 | 168 | Network |
| Third Octet | 00000001 | 1 | Network |
| Fourth Octet | 00000000 | 0 | Host |
The first 24 bits (3 complete octets) are fixed for the network. The last 8 bits are available for host addresses within that network.
Subnetting: Dividing a /24 into Four /26 Networks
Starting from 192.168.1.0/24, you can divide it into four equal /26 subnets — useful for separating departments or security zones:
| Subnet | CIDR Block | Usable IP Range | Usable Hosts |
|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 – 192.168.1.62 | 62 |
| 2 | 192.168.1.64/26 | 192.168.1.65 – 192.168.1.126 | 62 |
| 3 | 192.168.1.128/26 | 192.168.1.129 – 192.168.1.190 | 62 |
| 4 | 192.168.1.192/26 | 192.168.1.193 – 192.168.1.254 | 62 |
Each /26 provides 62 usable addresses and network-level isolation between segments — a common pattern for department or VLAN separation.
Common Mistakes to Avoid
Assigning the network address to a device
The first address in a subnet (e.g., 192.168.1.0 in a /24) identifies the network itself. It cannot be assigned to any host.
Assigning the broadcast address to a device
The last address (e.g., 192.168.1.255 in a /24) is reserved for broadcast traffic. Assigning it to a device causes routing issues.
Counting total vs. usable addresses A /24 has 256 total addresses, but only 254 are usable. Always subtract 2 for the network and broadcast addresses.
Assuming larger prefix = larger network A /30 is far smaller than a /24. More prefix bits = fewer host bits = smaller network.
Where You’ll Use CIDR in Practice
- Home networks: Your router almost certainly uses
192.168.1.0/24or192.168.0.0/24internally. - Corporate networks: Separate subnets per department or floor, typically /24 blocks within a larger /16 allocation.
- Cloud infrastructure: AWS, Azure, and GCP require CIDR when defining VPCs and subnets. AWS reserves 5 addresses per subnet (the standard 2 plus 3 additional), so a /24 in AWS gives you 251 usable IPs, not 254 — the AWS Subnet Calculator accounts for this automatically.
- Internet routing: ISPs receive large CIDR allocations (e.g., /12) from regional registries and subdivide them for customers.
Key Takeaways
- Format is
IP/prefix— the prefix tells you where the network boundary sits - Larger prefix number = smaller network — /28 is smaller than /16
- Always subtract 2 from the host count — network and broadcast addresses are reserved
- AWS subtracts 5 — account for cloud provider reservations when sizing VPC subnets
- Start practicing with /24 — 254 usable addresses, clean octet boundary, widely used
Practice Questions
Test your understanding before moving on:
Q1: What is the usable IP address range for 10.50.0.0/16?
A: 10.50.0.1 to 10.50.255.254 — 65,534 usable addresses.
Q2: How many /24 subnets can you create from a /22 network?
A: 4 subnets (2^(24−22) = 4).
Q3: Can you assign 172.16.5.255 to a device in 172.16.5.0/24?
A: No — that’s the broadcast address.
Use our subnet calculator to verify these and try your own. For more advanced scenarios, see our subnet calculation hacks for network engineers or the AWS VPC subnetting guide.