What Is CIDR? IP Prefixes and Address Blocks Explained

CIDR uses a slash prefix such as /24 to state how many leading bits identify an IP network prefix, allowing address blocks and ranges to be represented without the older fixed class boundaries.

How it works

CIDR notation combines an IP address with a prefix length. The prefix fixes the leading network bits, while the remaining bits vary across addresses in the block. The prefix therefore determines the normalized network boundary, the size of the block, and its first and last addresses.

How to read CIDR slash notation

IPv4 addresses contain 32 bits. In 192.0.2.0/24, the /24 means that the first 24 bits form the network prefix and the remaining 8 bits can vary within that address block. It does not mean that the block contains 24 addresses.

The address written before the slash can be any address inside the prefix when used as input. A calculator can normalize 192.0.2.42/24 to the actual block boundary, 192.0.2.0/24, because the final 8 bits do not form part of that /24 network prefix.

CIDR means Classless Inter-Domain Routing. Classless addressing allows prefixes of different lengths instead of restricting networks to the older fixed Class A, B, and C boundaries. Modern routing and allocation decisions use the prefix length, not a legacy class label.

How prefix length determines block size

The 8 variable bits in 192.0.2.0/24 produce 256 total combinations. The resulting IPv4 block begins at 192.0.2.0 and ends at 192.0.2.255. This total describes every address in the block; deciding which addresses have special subnet roles is a separate operational question.

A larger prefix number leaves fewer variable bits and creates a smaller block. For example, moving from /24 to /25 fixes one additional bit, so each /25 contains half as many addresses as a /24. A smaller prefix number leaves more bits available and creates a larger block.

For IPv4, the total-address calculation is 2 raised to the number of remaining bits. A /24 leaves 32 minus 24, or 8 bits, so its total is 2 to the eighth power: 256. Understanding the fixed-versus-variable split is more useful than memorizing a list of block sizes.

Address blocks, ranges, and aggregation

A valid CIDR block represents a contiguous, power-of-two-sized range aligned to the prefix boundary. That alignment lets routing systems and access rules describe many addresses with one prefix instead of listing each address separately.

Adjacent aligned blocks can sometimes be represented by a shorter aggregate prefix. Aggregation can reduce the number of route or policy entries, but the larger block must describe exactly the intended addresses. Combining ranges carelessly can include addresses that were not part of the original set.

An arbitrary inclusive range may not begin or end on one CIDR boundary. In that case, representing it exactly requires several CIDR blocks. A range-to-CIDR conversion finds aligned blocks that cover the supplied range without adding addresses outside it.

Calculating and converting CIDR ranges

From IPv4 CIDR notation, a calculator can derive the normalized network prefix, first and last addresses, total address count, and equivalent masks. These are mathematical properties of the entered block rather than live observations about the internet.

A calculation does not say which organization operates the range, whether it is currently announced in routing, whether a host responds, or whether an address is safe to allow. Those questions require separate registration, routing, reachability, and security evidence.

Use a subnet calculator when the practical question is about network and host portions, broadcast behavior, or traditional usable-host ranges. Use a range-to-CIDR converter when a supplied first and last address must be represented as the smallest exact collection of aligned CIDR blocks.

Practical guidance

Common question

Does /24 mean 24 IP addresses? No. In IPv4 it means 24 of 32 bits form the prefix, leaving 8 variable bits and therefore 256 total addresses in the block.

Try the relevant tool

Calculate the normalized IPv4 network boundary, address range, masks, and address count for a CIDR prefix.

Calculate a CIDR range