Cybersecurity

What is CIDR Notation and How Do I Read It?

Master CIDR notation including /24, /16, /32 and learn how to calculate network sizes and subnet masks.

By Inventive HQ Team

What CIDR notation actually means

CIDR notation writes an IP network as an address followed by a slash and a number — like 10.0.0.0/24 — where the number is the prefix length: how many of the address's 32 bits are locked as the network portion, leaving the rest free for host addresses. In 10.0.0.0/24, the /24 fixes the first 24 bits (10.0.0) and leaves the last 8 bits for hosts, which produces 256 total addresses and 254 usable ones. The rule that governs everything else is simple: each time the prefix number gets smaller by one, the network doubles in size; each time it gets larger by one, the network halves. That is the entire mechanic — no address classes, no lookup tables.

That's the summary an AI Overview will hand you. What it can't show you is the bit-level picture that makes the slash number click, a size table you can read at a glance, and a calculator that does the math on your own address. CIDR ("Classless Inter-Domain Routing," defined in RFC 4632) replaced the old Class A/B/C system in 1993 precisely because those fixed classes wasted enormous ranges — CIDR lets a network be any power-of-two size. Below is how to read it without memorizing anything.

The slash number is a boundary, not a count

The most common mistake is reading /24 as "24 somethings." It isn't a count of addresses or octets — it is the position of the boundary between network bits and host bits on a 32-bit ruler. Everything to the left of the boundary is shared by every device on the network; everything to the right is free to number individual hosts.

How a CIDR prefix splits 32 bits into network and host portions A 32-bit IPv4 address shown as four octets; a /24 boundary marks the first 24 bits as network and the last 8 as host. 10.0.0.0/24 — where the boundary falls

bits 1–8 bits 9–16 bits 17–24 bits 25–32

10 0 0 0 → 255 /24 boundary

24 network bits — shared by all hosts 8 host bits

2^8 = 256 total addresses 254 usable for hosts 10.0.0.0 = network · 10.0.0.255 = broadcast first and last address are reserved

Move that red boundary one bit to the right and you have a /25 — the network now owns 25 bits, hosts get 7, and the block shrinks to 128 addresses. Move it left to /23 and hosts get 9 bits, so the block grows to 512. The slash number is just where the line sits.

CIDR block size at a glance

Because every prefix is a power of two, you don't need to calculate — you need to recognize. Here are the blocks you will actually meet in firewall rules, cloud VPCs, and DHCP scopes.

CIDRSubnet maskTotal addressesUsable hostsTypical use
/32255.255.255.25511A single host in a firewall/ACL rule
/31255.255.255.25422 (RFC 3021)Point-to-point router links
/30255.255.255.25242Legacy point-to-point / tiny links
/29255.255.255.24886A handful of servers or an ISP hand-off
/28255.255.255.2401614Small DMZ or appliance segment
/27255.255.255.2243230Small office subnet
/26255.255.255.1926462Mid-size VLAN
/24255.255.255.0256254The classic single LAN / VLAN
/23255.255.254.0512510Large flat LAN
/16255.255.0.065,53665,534An entire site or large cloud VPC
/8255.0.0.016,777,21616,777,214A whole private 10.x range

Which one should I pick? Size to the hosts you actually have plus realistic growth, then round up to the next prefix. Need room for 40 devices? A /27 (30 usable) is too small, so use a /26 (62 usable). Over-allocating a /24 to a 5-device management segment isn't wrong, but it wastes address space you'll want back when you subnet later. When in doubt, /24 per VLAN is the sane default that keeps the math trivial.

Two addresses are always subtracted for a normal subnet: the network address (all host bits 0) and the broadcast address (all host bits 1). That's why usable is total minus two — except /31 (RFC 3021 point-to-point, both usable) and /32 (a single host, no network/broadcast split).

Advertisement

Reading any CIDR in your head: the doubling ladder

You can convert prefix to size without arithmetic if you anchor on /24 = 256 and remember that down one prefix doubles, up one halves.

The CIDR doubling ladder anchored at /24 Each step down in prefix number doubles the address count; each step up halves it, anchored at /24 equals 256. Anchor at /24 = 256, then step

← smaller prefix = bigger network (×2) bigger prefix = smaller network (÷2) →

/22 1024
<rect x="170" y="90" width="120" height="70" rx="8" fill="#ffffff" stroke="#e2e8f0"/>
<text x="230" y="122" text-anchor="middle" fill="#2813e8">/23</text>
<text x="230" y="145" text-anchor="middle" fill="#334155" font-weight="400">512</text>

<rect x="310" y="90" width="120" height="70" rx="8" fill="#ffffff" stroke="#2813e8" stroke-width="2.5"/>
<text x="370" y="122" text-anchor="middle" fill="#2813e8">/24</text>
<text x="370" y="145" text-anchor="middle" fill="#0f172a" font-weight="700">256</text>

<rect x="450" y="90" width="120" height="70" rx="8" fill="#ffffff" stroke="#e2e8f0"/>
<text x="510" y="122" text-anchor="middle" fill="#2813e8">/25</text>
<text x="510" y="145" text-anchor="middle" fill="#334155" font-weight="400">128</text>

<rect x="590" y="90" width="120" height="70" rx="8" fill="#ffffff" stroke="#e2e8f0"/>
<text x="650" y="122" text-anchor="middle" fill="#2813e8">/26</text>
<text x="650" y="145" text-anchor="middle" fill="#334155" font-weight="400">64</text>

Total addresses = 2^(32 − prefix). Usable = that − 2 (except /31 and /32). Every whole step is exactly a factor of two — no other numbers appear.

So /22 is "two doublings below /24" = 256 × 2 × 2 = 1024, and /27 is "three halvings below /24" = 256 ÷ 8 = 32. Once the ladder is muscle memory you can size any block on a whiteboard.

Convert a prefix to a subnet mask (and back)

The subnet mask is the same boundary expressed in dotted-decimal instead of a slash. Lay 32 bits out, fill the leftmost prefix count with 1s, fill the rest with 0s, then read each octet as a decimal number.

  • /2411111111.11111111.11111111.00000000255.255.255.0
  • /2611111111.11111111.11111111.11000000255.255.255.192
  • /2011111111.11111111.11110000.00000000255.255.240.0

Only nine values ever appear in a single octet as you fill it from the left: 0, 128, 192, 224, 240, 248, 252, 254, 255. Seeing 192 in a mask means "two host bits used in this octet," which is the /26 case above. Going the other way, count the 1s: 255.255.255.128 has 25 ones, so it's a /25.

Do the math on your own address

The recognition tricks above cover the common blocks. For an arbitrary address — finding the network address, the broadcast, the exact usable range, or splitting a block into smaller subnets — let the calculator handle the bit masking so you don't fat-finger an octet. Enter any address and prefix and it returns the network, broadcast, mask, and host range instantly.

Loading interactive tool...

Where CIDR shows up in real work

  • Firewall and security-group rules. 0.0.0.0/0 means "any address" (the whole internet); 203.0.113.7/32 means exactly one host. Getting the prefix wrong here is a security incident, not a typo — /24 where you meant /32 opens 254 extra hosts.
  • Cloud VPCs. AWS, Azure, and GCP all define VPCs and subnets in CIDR. A common pattern is a /16 VPC carved into /24 subnets per tier or availability zone.
  • Routing tables. Routers match the longest prefix first, so a /32 route wins over a /24 that also contains the address. This "longest-prefix match" is how specific overrides coexist with broad default routes.
  • Private ranges. RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for private use — the blocks behind almost every home and office NAT.

The bottom line

CIDR notation is one idea applied consistently: the slash number marks the boundary between network bits and host bits on a 32-bit address, and moving that boundary by one bit doubles or halves the block. Memorize /24 = 256 = 254 usable, learn the doubling ladder in both directions, and you can read any IPv4 CIDR on sight. For anything that needs exact network and broadcast addresses, subnet the block with the subnet calculator rather than doing binary by hand — and when you're ready to carve a range into VLANs, read what subnetting is and why to use it next.

Frequently Asked Questions

What does the number after the slash in CIDR mean?

The number after the slash is the prefix length: how many of the address's 32 bits (for IPv4) are fixed as the network portion. In 10.0.0.0/24, the first 24 bits identify the network and the remaining 8 bits are free for hosts. A larger number means a smaller network with fewer addresses.

How many addresses are in a /24?

A /24 contains 256 total addresses (2^(32-24) = 2^8). Of those, 254 are usable for hosts because the first address (10.0.0.0) is the network address and the last (10.0.0.255) is the broadcast address. This is why a /24 is the classic "one office LAN" block.

What is the difference between a /24 and a /16?

A /24 fixes 24 network bits and leaves 8 host bits, giving 256 addresses. A /16 fixes only 16 network bits and leaves 16 host bits, giving 65,536 addresses — 256 times larger. Each drop of one in the prefix number doubles the size of the block.

What does /32 mean in CIDR?

A /32 fixes all 32 bits, so it represents exactly one IPv4 address with no room for hosts. It is used in firewall rules, route tables, and access lists when you want to match a single host, for example allowing 203.0.113.7/32 through a security group.

How do I convert a CIDR prefix to a subnet mask?

Write the prefix number as that many 1 bits followed by 0 bits across 32 positions, then group into four octets. A /24 is 11111111.11111111.11111111.00000000, which is 255.255.255.0. A /26 is 255.255.255.192. A /16 is 255.255.0.0.

Why is a /31 special?

A /31 has only two addresses and normally both would be consumed by the network and broadcast addresses, leaving zero usable hosts. RFC 3021 redefines /31 for point-to-point links so both addresses are usable, which is why you see /31 on router-to-router connections.

What is the smallest CIDR block I can assign to a LAN?

For a normal multi-host LAN the practical floor is a /30, which gives 4 total addresses and 2 usable hosts. Below that you use /31 for point-to-point links (2 usable per RFC 3021) or /32 for a single host.

Does CIDR work the same way in IPv6?

The concept is identical — the prefix length counts fixed network bits — but IPv6 addresses are 128 bits instead of 32. A /64 is the standard IPv6 subnet size and already contains 18 quintillion addresses, so IPv6 subnetting is about hierarchy and routing, not conserving host space.

CIDRIP addressingsubnet masknetworkingIPv4