CIDR Notation Explained

CIDR (Classless Inter-Domain Routing) is the modern way to describe IP address ranges. Instead of old-school classful addressing (Class A, B, C), CIDR uses a prefix length (the number after the slash) to define exactly how large a network is.

What the Slash Means

In 192.168.1.0/24, the /24 tells you that the first 24 of the 32 bits are the network portion. The remaining 8 bits are for hosts.

CIDRSubnet MaskAddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422*
/32255.255.255.25511*

* /31 is used for point-to-point links (RFC 3021). /32 is a single host route.

CIDR vs. Classful Addressing

Before CIDR (pre-1993), IP addresses were divided into rigid classes:

  • Class A (/8): 10.0.0.0, giving 16 million hosts. Way too large for most organizations.
  • Class B (/16): 172.16.0.0, giving 65K hosts. Still too large for many.
  • Class C (/24): 192.168.1.0, giving 254 hosts. Too small for some.

This was incredibly wasteful. A company needing 500 hosts would get a full Class B (65K addresses), wasting 99% of the space. CIDR replaced this with variable-length prefixes, so you can allocate exactly the right size block.

How to Read CIDR

The formula is simple:

  • Total addresses = 2^(32 - prefix)
  • Usable hosts = total - 2 (network address + broadcast)

Example: /26 gives 2^(32-26) = 2^6 = 64 addresses, 62 usable.

Each time you add 1 to the prefix, you halve the block:

  • /24 = 256 addresses
  • /25 = 128
  • /26 = 64
  • /27 = 32
  • And so on.

Common CIDR Blocks in Practice

Use CaseTypical CIDRWhy
Home network/24254 devices is plenty
Small office/23 or /24500 or 254 hosts
AWS VPC/16Default VPC size
AWS subnet/24 or /25Per-AZ subnets
Point-to-point link/30 or /31Only 2 hosts needed
Loopback / host route/32Single address

Supernetting (CIDR Aggregation)

CIDR also works in reverse. You can combine multiple smaller networks into one larger supernet. This is called route aggregation and is critical for keeping the global routing table manageable.

For example, four /24 networks (192.168.0.0 through 192.168.3.0) can be aggregated into a single /22 announcement.

Try It

Use our subnet calculator to experiment with different CIDR sizes. Enter any network and prefix, then split and join to see how the addresses divide.

See the full subnet cheat sheet for every prefix from /0 to /32.

References