CIDR Notation Explained: How to Read /24, /16, and /30

Decode any CIDR block in seconds: what the slash means, the IP range it covers, and the host count.

TL;DR
  • CIDR notation pairs an IP address with a slash and a prefix length.
  • The prefix length counts the network bits, from /0 to /32.
  • A smaller number after the slash means a bigger block.
  • Total addresses equal 2 to the power of (32 minus the prefix).
  • Use our free converter to expand any block instantly.

What is CIDR notation?

CIDR notation is a compact way to write an IP address and its network size together. It pairs an address with a slash and a prefix length, like 192.168.1.0/24. The prefix length counts the network bits. Everything after that defines the host range.

CIDR stands for Classless Inter-Domain Routing. It replaced the old Class A, B, and C system in the 1990s.

Before CIDR, address blocks came in three rigid sizes. That wasted huge ranges and drained IPv4 fast.

CIDR let networks use any prefix length instead. The result is finer control and far less waste. The standard is defined in RFC 4632, a Best Current Practice from 2006.

How to read a CIDR block

Read a CIDR block in two parts: the address and the prefix. The address sits before the slash. The number after the slash is the prefix length. It tells you how many leading bits identify the network, leaving the rest for hosts.

The address part

The address part looks like any normal IPv4 address. In 10.0.0.0/8, the address is 10.0.0.0.

It marks the start of the block, called the network address. The host bits that follow are all set to zero here.

The slash and prefix length

The prefix length is a number from 0 to 32. It counts the bits locked to the network.

A /24 locks the first 24 bits. The final 8 bits are free for hosts. If the bit math feels abstract, our IP to binary converter shows it directly.

Turning a prefix into a subnet mask

Every prefix maps to exactly one subnet mask. A /24 equals 255.255.255.0.

The mask is just the prefix written as four decimal numbers. Ones cover the network bits, zeros cover the host bits.

What /24, /16, and other prefixes mean

Each prefix length describes a fixed block size. A /24 holds 256 addresses, a /16 holds 65,536, and a /8 holds over 16 million. A smaller prefix number means a larger block. The table below shows the most common blocks at a glance.

CIDR Subnet mask Total addresses Usable hosts Often used for
/30255.255.255.25242Point-to-point links
/29255.255.255.24886Tiny subnets
/28255.255.255.2401614Small LAN segments
/27255.255.255.2243230Small offices
/26255.255.255.1926462Medium subnets
/24255.255.255.0256254Standard LAN
/23255.255.254.0512510Larger LAN
/22255.255.252.01,0241,022Large LAN
/20255.255.240.04,0964,094Campus subnet
/16255.255.0.065,53665,534Large private network
/8255.0.0.016,777,21616,777,214Very large allocation

The private ranges in RFC 1918 use these blocks too. 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 are the common ones. Our guide on public vs. private IP addresses covers why they exist.

How to calculate the IP range and host count

To find the range, take the prefix and apply one formula. Total addresses equal 2 raised to the power of 32 minus the prefix. Usable hosts equal that total minus two. One address is the network, one is the broadcast.

Take 192.168.1.0/24 as an example. The math is 2 to the power of (32 minus 24).

That is 2 to the 8th, or 256 total addresses. Subtract two and you get 254 usable hosts.

The first address, 192.168.1.0, is the network address. The last, 192.168.1.255, is the broadcast address.

Neither one is assigned to a device. That is why a /24 gives 254 hosts, not 256.

The /31 and /32 exceptions

Two prefixes break the minus-two rule. A /32 describes a single host address, often used in routing.

A /31 has only two addresses and no room to spare. RFC 3021 lets both be used on point-to-point links.

Convert any CIDR block with our tool

You do not have to do the math by hand. Paste any CIDR block into our converter and read the result. It returns the start and end IP, the network and broadcast addresses, and the total host count in one step.

This is where NetworkCheckr saves you time. Most guides explain the math but leave you to crunch it.

Run any block through our CIDR to IP Range converter instead. It does the full expansion instantly.

Need to split a block into smaller subnets? Our subnet calculator handles that next step.

For the full theory behind it, read our beginner’s guide to subnetting.

CIDR notation in IPv6

IPv6 uses the exact same slash notation. The address is longer, but the rule is identical. A prefix like 2001:db8::/32 locks the first 32 bits. The common subnet size is /64, which leaves 64 bits for hosts.

IPv6 addresses are 128 bits, not 32. So prefixes run from /0 all the way to /128.

The math still holds: a prefix counts the network bits. Hosts fill whatever bits remain.

Most networks assign a /64 to each subnet. That single subnet holds more addresses than the entire IPv4 internet. For the wider picture, see our guide on IPv4 vs. IPv6.

Common CIDR mistakes to avoid

A few mistakes trip people up with CIDR. Confusing total addresses with usable hosts is the most common. Forgetting the network and broadcast addresses is another. Mixing up a /24 and a /16 can size a network completely wrong.

Remember that a smaller prefix means more addresses. A /16 is far bigger than a /24, not smaller.

Always subtract two for usable hosts on normal subnets. The network and broadcast addresses are never assigned to devices.

Watch the boundaries when you split blocks. A /25 starts at .0 or .128, never in between.

When in doubt, let a tool confirm it. Guessing the range by eye invites errors.

Frequently asked questions

What does CIDR notation mean?

CIDR notation writes an IP address with a slash and a prefix length, like 192.168.1.0/24. The prefix length counts the network bits. The remaining bits define the host range. It replaced the old class-based system to reduce address waste.

What does /24 mean in an IP address?

A /24 means the first 24 bits are the network portion. That leaves 8 bits for hosts. The block holds 256 total addresses and 254 usable ones. Its subnet mask is 255.255.255.0.

How do I calculate the number of hosts in a CIDR block?

Take 2 to the power of 32 minus the prefix length. That gives the total addresses. Subtract two for the network and broadcast addresses. A /26, for example, gives 64 total and 62 usable hosts.

Is a smaller CIDR number a bigger network?

Yes. A smaller prefix number means a larger block of addresses. A /16 holds 65,536 addresses, while a /24 holds only 256. The smaller the number after the slash, the more hosts the block contains.

What is the difference between CIDR and a subnet mask?

They carry the same information in different formats. A prefix like /24 equals the subnet mask 255.255.255.0. CIDR notation is shorter, while the mask is the older dotted-decimal form. Both define where the network ends and hosts begin.

Does CIDR notation work for IPv6?

Yes. IPv6 uses the same slash notation as IPv4. A prefix such as 2001:db8::/32 locks the first 32 bits. Most subnets use a /64 prefix, leaving 64 bits for host addresses.

Secret Link