CIDR Notation Explained: How /24, /16 and /8 Networks Work
The number after the slash determines everything about a network's size. Here's exactly how to read it.
The number after the slash in an address like 10.0.0.0/8 or 192.168.1.0/24 is doing all the work - it tells you exactly how many addresses that network contains and how it should be subdivided. Here's how to read it at a glance, plus a full reference table.
The core idea
An IPv4 address is 32 bits. The CIDR prefix is where you draw the line between the network portion (identical for every device on that network) and the host portion (unique per device). A /24 draws that line after the 24th bit, leaving 8 bits - 2^8 = 256 addresses - for hosts.
/8, /16, and /24 side by side
| Prefix | Network bits | Host bits | Total addresses | Usable hosts | Typical use |
|---|---|---|---|---|---|
| /8 | 8 | 24 | 16,777,216 | 16,777,214 | Very large private ranges (e.g. 10.0.0.0/8) |
| /16 | 16 | 16 | 65,536 | 65,534 | Large internal networks, cloud VPCs |
| /24 | 24 | 8 | 256 | 254 | Typical office or home LAN, common cloud subnet |
Full reference table
| Prefix | Subnet mask | Total addresses | Usable hosts |
|---|---|---|---|
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /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 |
Usable hosts = total addresses minus 2 (the network address and broadcast address), except for /31 and /32, which are special cases - see What Does /32 Mean in CIDR? for that one.
Worked example: 192.168.1.0/24
- The /24 fixes the first three octets: 192.168.1 is the network portion.
- The last octet (8 bits) is free for hosts: values 0-255.
- 192.168.1.0 is the network address (not assignable).
- 192.168.1.255 is the broadcast address (not assignable).
- 192.168.1.1 through 192.168.1.254 are usable - 254 addresses.
Why the reference table matters in practice
Knowing these numbers cold speeds up two very common tasks: sizing a subnet for a known device count ("we need room for 50 hosts, so at minimum a /26"), and sanity-checking someone else's network plan at a glance without opening a calculator.
That said, for anything beyond the handful of common prefixes, or when you need the exact network and broadcast addresses for a specific block rather than just the counts, it's faster and less error-prone to run it through the CIDR Calculator than to work it out by hand.
Common mistakes
- Confusing the prefix length with the number of addresses directly - remember it's an exponent (2^(32-prefix)), not a linear scale.
- Forgetting that the network and broadcast addresses in a subnet aren't assignable to hosts.
- Mixing up /8 and /24 in casual conversation - an /8 is 65,536 times larger than a /24, not just "a bit bigger."
Summary
CIDR prefix length directly determines network size: fewer network bits (a smaller prefix number) means more addresses. /8, /16, and /24 cover the vast majority of real-world network sizing needs, but the same math extends cleanly to every prefix from /0 to /32.
Frequently asked questions
- What does /24 mean?
- It means the first 24 bits of the IP address are fixed as the network portion, leaving 8 bits (256 addresses, 254 usable) for hosts. A /24 is the most common subnet size for a typical LAN.
- How many addresses are in a /16?
- 65,536 total addresses (2^16), since 16 bits are left for hosts. Of those, 65,534 are usable after the network and broadcast addresses are reserved.
- Is a smaller prefix number a bigger or smaller network?
- Bigger. A /8 has far more addresses than a /24 - the prefix number is the count of fixed network bits, and fewer fixed bits means more bits left over for hosts.
Try it yourself
The tool that pairs with this guide.
Did this make subnetting easier?
If these free developer tools save you time, consider buying me a byte. Your support helps keep DevCraftKit free and growing.
Related articles
What Is CIDR? A Complete Guide to Classless Inter-Domain Routing
CIDR notation packs an IP address and its network size into one compact string. Here's exactly what it means and how to read it.
Updated
Understanding IPv4 Subnetting: A Practical Guide
Subnetting is how one IP range gets divided into smaller, purpose-built networks. Here's a practical walkthrough with real examples.
Updated
CIDR vs. Subnet Mask: What's the Difference?
A /24 and 255.255.255.0 mean the same thing. Here's how CIDR notation and subnet masks map to each other.
Published