Skip to main content
Networking
Published · Updated 10 min read

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.

If you've spent any time around networking, you've seen addresses written like 192.168.1.0/24 or 10.0.0.0/16. That slash and number - CIDR notation - is one of the most useful shorthand conventions in networking, and once it clicks, a lot of networking concepts get much easier to reason about.

This guide covers what CIDR actually means, why it exists, how to read a CIDR block by hand, and where it shows up in real infrastructure work - from home routers to cloud VPCs.

CIDR in one sentence

CIDR (Classless Inter-Domain Routing) is a way of writing an IP address together with how many of its bits define the network, so that a single string like 192.168.1.0/24 tells you both the network and its size.

Quick answer

192.168.1.0/24 means: the network is 192.168.1.0, and the first 24 bits (192.168.1) are fixed for every device on that network - leaving the last 8 bits free to identify up to 256 individual addresses.

Why "classless"? A brief history

Before CIDR, IPv4 addresses were divided into rigid classes:

ClassFirst octet rangeDefault network sizeHosts per network
A0-127/816,777,214
B128-191/1665,534
C192-223/24254

The problem: real organizations rarely needed exactly 16 million addresses (Class A) or exactly 254 (Class C). A company with 300 employees didn't fit cleanly into either a Class B (wasting tens of thousands of addresses) or multiple Class Cs (fragmenting routing tables). By the early 1990s, this rigidity was accelerating IPv4 address exhaustion and bloating global routing tables.

CIDR, standardized in 1993, fixed both problems at once. Instead of fixed class boundaries, any network could be any size, expressed as a prefix length from /0 (the entire address space) to /32 (a single address). This also enabled route aggregation - many small networks could be summarized as one CIDR block in routing tables, which was critical for the internet's continued growth.

Reading a CIDR block step by step

Take 192.168.1.100/24 as an example - the same one used throughout our CIDR Calculator's documentation.

  1. Convert the IP address to binary: 192.168.1.100 becomes 11000000.10101000.00000001.01100100.
  2. The /24 means the first 24 bits are the network portion: 11000000.10101000.00000001.
  3. Everything after bit 24 (the remaining 8 bits) is the host portion: 01100100.
  4. To find the network address, set all host bits to 0: 192.168.1.0.
  5. To find the broadcast address, set all host bits to 1: 192.168.1.255.
  6. Usable host addresses are everything between those two: 192.168.1.1 through 192.168.1.254 - 254 addresses.

Doing this by hand is a good exercise for building intuition, but for real work - especially with less common prefixes like /20 or /27 - a calculator removes the risk of an off-by-one error. Our CIDR Calculator does exactly this breakdown instantly, including the binary view so you can see which bits are network vs. host.

Common CIDR prefixes and what they mean

PrefixSubnet maskTotal addressesUsable hostsTypical use
/32255.255.255.25511A single host route
/30255.255.255.25242Point-to-point links
/29255.255.255.24886Small server clusters
/27255.255.255.2243230Small office subnet
/24255.255.255.0256254Typical LAN or cloud subnet
/16255.255.0.065,53665,534Large private network or VPC

Where CIDR shows up in real work

  • Cloud infrastructure: AWS VPCs, Azure virtual networks, and GCP VPCs all use CIDR blocks to define IP ranges when you provision infrastructure.
  • Firewall and security group rules: rules are frequently scoped to a CIDR block (e.g. "allow SSH from 10.0.0.0/8 only") rather than a single IP.
  • Router configuration: static routes and DHCP scopes are defined using CIDR-style ranges.
  • Access control lists (ACLs): many ACLs accept a CIDR block to allow or deny an entire range of addresses at once.

Common mistakes with CIDR

  • Confusing the network address with a usable host address - the network address (all-zero host bits) is not assignable to a device.
  • Forgetting that /31 and /32 are special cases: /32 identifies a single host with no separate network/broadcast address, and /31 (per RFC 3021) is used for point-to-point links where both addresses are usable.
  • Assuming a smaller prefix number means a smaller network - it's the opposite. A /8 is a huge network; a /30 is a tiny one.
  • Manually calculating broadcast addresses for uncommon prefixes and getting the binary math wrong - this is exactly the kind of task worth double-checking with a calculator.

CIDR vs. subnet mask notation

CIDR notation (/24) and dotted-decimal subnet masks (255.255.255.0) describe exactly the same information in different formats. Most modern tooling accepts either, but CIDR notation is more compact and is the standard in cloud consoles, routing tables, and configuration files. For a deeper side-by-side comparison, see our dedicated guide on CIDR vs. subnet mask.

For a closer look at how specific prefixes like /8, /16, and /24 compare, see CIDR Notation Explained. If you need the exact address count for a given prefix, How to Calculate the Number of IP Addresses in a CIDR Block walks through the formula.

Summary

CIDR notation compresses an IP address and its network size into one compact string. The prefix length tells you how many bits are fixed for the network, which in turn determines the network address, broadcast address, and usable host range. It replaced the rigid classful system to make IP address allocation dramatically more efficient, and it's the standard way networks are described in cloud platforms, routers, and firewalls today.

The fastest way to work with CIDR blocks in practice - without redoing binary math by hand every time - is to run them through a calculator.

Frequently asked questions

What does the number after the slash in CIDR mean?
It's the prefix length - the number of bits, out of 32 for IPv4, that make up the network portion of the address. A /24 means the first 24 bits identify the network, leaving 8 bits (256 addresses) for hosts.
Is CIDR the same as a subnet mask?
They describe the same thing in different formats. A /24 prefix and a 255.255.255.0 subnet mask represent an identical network size - CIDR notation is just more compact.
Why was CIDR introduced?
The original classful system (Class A, B, C) wasted enormous numbers of IP addresses because networks could only be sized in fixed, large increments. CIDR, introduced in 1993 via RFC 1518 and RFC 1519, let networks be sized to whatever they actually needed.
Can CIDR notation be used for more than just IP addresses?
The notation itself (address/prefix-length) is specific to IP networking, but the same variable-length prefix idea is used elsewhere in routing, such as in BGP route aggregation.

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.

Buy me a byte 💾