As a network engineer, administrator, or Site Reliability Engineer (SRE) you probably have run across CIDR notation for defining IPv4 address spaces for both networks and subnets. CIDR notation is used a lot in the IT infrastructure configuration world. The following is a description of what CIDR notation is, in case you’re not that familiar, as well as a helpful CIDR range calculator and reference table. I hope these resources prove useful for you when defining CIDR ranges for your networks and subnets.

What is CIDR IPv4 Address Range Notation?

CIDR stands for “Classless Inter-Domain Routing”, and is the method used for assigning IP addresses and routing Internet traffic. IPv4 CIDR notation, specifically, is a way of representing a range of IP addresses in a concise and standardized format. CIDR notation is commonly used by network engineers, administrators, and Site Reliability Engineers (SRE) to manage IP addresses and create subnets.

CIDR notation is a flexible and efficient allocation of IP addresses by allowing the use of variable-length subnet masks. The network portion and the host portion of an IP address are not fixed, but can be specified by a number known as the CIDR prefix.

The CIDR prefix is written as a slash followed by a number between 0 (zero) and 32. The number represents the number of network bits in the subnet mask, and is used to determine the range of IP addresses that belong to the network. For example, the CIDR prefix of /24 indicates that the first 24 bits of the IP address represent the network address, while the remaining 8 bits represents the host address.

To calculate the CIDR prefix for a given IP address range, you need to count the number of leading 1 bits in the binary representation of the subnet mask. For example, the subnet mask of (in dotted decimal notation) has 24 leading 1 bits, so its CIDR prefix is /24.

If this sounds a little difficult for you to calculate, then the following calculator and reference table for IPv4 CIDR notations should prove useful.

Calculate Start/End IPv4 Addresses for CIDR Range

When calculating the CIDR range of IPv4 IP addresses, it can be difficult to figure out the full range of IP Addresses that are included within the CIDR range. At least if you aren’t familiar with the binary math needed to calculate it. For this reason, I’ve included the following calculator that allows you to enter the CIDR range, click “Calculate”, then it will display the Starting IP Address and Ending IP Address of the CIDR range entered.

IPv4 Address CIDR Range Reference Table

Some times it can be difficult to remember how many IP addresses are in each of the CIDR ranges that can be defined. These range from a /0 with the entire IPv4 address space, down to a /32 that only includes a single IP address in the range.

The following table lists out all the CIDR ranges with the number of IPv4 address within that range:

CIDR RangeAddress MaskIP Address Count
(entire IPv4 address space)

Note: The IP address count column shows the total number of IP addresses within each CIDR range, including the network address and broadcast address.

Microsoft MVP

Chris Pietschmann is a Microsoft MVP, HashiCorp Ambassador, and Microsoft Certified Trainer (MCT) with 20+ years of experience designing and building Cloud & Enterprise systems. He has worked with companies of all sizes from startups to large enterprises. He has a passion for technology and sharing what he learns with others to help enable them to learn faster and be more productive.
HashiCorp Ambassador Microsoft Certified Trainer (MCT) Microsoft Certified: Azure Solutions Architect