Omni Calculator logo

CIDR Calculator β€” Classless Inter-Domain Routing

Created by Rijk de Wet
Reviewed by Steven Wooding
Last updated: Jan 18, 2024

Welcome to Omni's CIDR calculator! Classless interdomain routing (CIDR) revolutionized the internet and how IP addresses are assigned. However, CIDR notation isn't simple at first β€” so we made this CIDR block calculator to help!

Our CIDR calculator can convert a CIDR block into an IP range β€” and, given an IP range, this CIDR block calculator will find the CIDR notation that captures that range. In this article, we'll cover essential topics such as:

  • What classless interdomain routing is;
  • How to calculate subnet mask from CIDR notation;
  • How to calculate IP range from CIDR; and
  • How to calculate CIDR from IP range.

πŸ’‘ Interested in IP addresses and subnetworks? Check out our IP subnet calculator!

How to use the CIDR range calculator

This CIDR subnet calculator has two modes, which you can select with the "I want to convert..." dropdown menu.

  • If you select CIDR to IPv4 range, the CIDR calculator will determine the range of IP addresses covered by the block you enter in CIDR notation.

    1. Give the calculator the CIDR notation β€” the IP address and associated subnet mask width.

    2. Verify that the CIDR notation is correct.

    3. Find your results at the bottom of the CIDR block calculator β€” we summarize the results, but we also go into depth on the subnet mask, the associated network prefix, the wildcard bits, and the range of IP addresses that this CIDR covers.

  • In IPv4 range to CIDR mode, the CIDR calculator will determine the network block(s) that cover the range between two IP addresses.

    1. Give the calculator two IP addresses β€” the first in the range and the last.

    2. Find the corresponding network block(s) below. One block that fits nicely into CIDR notation might not exist β€” in such cases, the CIDR calculator gives multiple blocks that cover your range.

    3. You can verify the output and learn about each network block with the CIDR to IPv4 range mode.

What is classless inter-domain routing (CIDR)?

CIDR is an ingenious method of allocation and routing of IP addresses. Before CIDR, the internet used a rather wasteful method of allocating IP addresses for specific subnetworks and their constituent hosts. Because of this inefficiency, the internet was quickly running out of IP addresses. CIDR is specifically called "classless" because it does not use "IP classes", which is exactly what made the previous system so inefficient.

What is CIDR notation?

CIDR notation is a compact way of denoting an IP address and its subnet mask. CIDR notation consists of an IP address, a slash (/), and a number between 0 and 32. This is the number of consecutive 1-bits (followed by more 0-bits) that make up the 32-bit subnet mask.

How to calculate IP range from CIDR

There are three steps to calculating the IP range from CIDR:

  1. Find the subnet mask.
  2. Apply the subnet mask.
  3. Use the wildcard bits to determine the IP range.

We'll use as an example throughout this process.

Find the subnet mask

The number after the slash is the width of our subnet mask. Our example ( has a subnet mask width of 25, meaning the mask has 25 1-bits and an additional 7 0-bits (to add up to 32 bits).

We can visualize the bits of the IP address and the mask as follows:

A bit diagram of an IP address.
The IP address, broken up into its binary representation.


A bit diagram of a subnet mask with length 25.
The subnet mask, consisting of 25 1-bits and 7 0-bits.


πŸ’‘ Not sure what these "bit" things are? Head on over to our binary calculator to learn more!

Apply the subnet mask

We've just learned how to calculate the subnet mask from CIDR notation. We can apply this mask to the IP address (rewritten in binary) with the bitwise AND operation. In practice, we take only the first 25 bits (since 25 is the decimal number in our CIDR, and discard the rest.

A bit diagram of a subnet prefix.
The network prefix of the CIDR block.

What's left is called the subnet prefix, which acts as an identifier for the block to which the specific IP address belongs. Our example's subnet prefix is

πŸ’‘ Check out our bitwise calculator for more information on the bitwise AND operation and others!

Determine the IP range

The bits not covered by the subnet mask are called the wildcard bits, and they are available to be filled with unique bit combinations to form unique IP addresses that all fall within our subnetwork. The zeros in the subnet mask are the wildcard bits, and so they are:

A bit diagram of a subnet's wildcards.
The wildcard bits of our subnet block.

Now that we know which bits can be changed while fitting within our subnet, we can finally determine the IP range! The range starts at the IP address with all 0s in the wildcard bit positions:

A bit diagram of an IP address.
The first IP address in our range β€” the pink is from the subnet prefix.

And the range ends at the IP address with all 1s in these positions:

A bit diagram of an IP address.
The last IP address in our range.

And there we have it β€” the IP range of the block is to! We can also see that we have 27 = 128 unique IP addresses in our network block.

How to calculate CIDR from IP range

While calculating the IP range from a CIDR is simple, calculating the CIDR from an IP range is more complex. In a nutshell, only some IP ranges are covered exactly by one single CIDR block. Consider the following cases, which you can verify using our CIDR subnet calculator in IPv4 range to CIDR mode:

The range to is covered by the single CIDR Great!

But what happens when we change the first IP address by just one bit? The range to needs five blocks to cover it completely:


Starts at

Ends at







Unfortunately, there's no smart solution to finding these CIDRs β€” you have to work it out by hand, consult a CIDR database, or use our CIDR notation calculator.


How do I calculate IP range from CIDR?

To extract the IP range from CIDR notation:

  1. Determine the subnet mask from the number after the slash.
  2. Find the network prefix by applying the mask to the IP address in binary form.
  3. Fill all the wildcard bits (the bits not covered by the mask) with 0s β€” this is the start of the IP range.
  4. Fill the wildcard bits with 1s β€” this is the end of the IP range.

What is the IP range of the CIDR

The CIDR covers the range of IP addresses from to, which are 16,777,216 unique IP addresses.

Rijk de Wet
I want to convert...
CIDR to IPv4 range
Enter your IP's octets (the numbers separated by dots) and the subnet mask width (the number after the slash) below:
First octet of IP
Second octet of IP
Third octet of IP
Fourth octet of IP
Subnet mask width
Your IP and subnet in CIDR notation is
Subnet mask width0
Subnet mask0.0.0.0
Wildcard bits255.255.255.255
First IP (network address)
Last IP (broadcast address)
Range4,294,967,296 IP addresses
Number of host addresses4,294,967,294 IP addresses
See the calculations?
Check out 32 similar tech and electronics calculators πŸ’»
3D printing costAmdahl's lawBattery capacity… 29 more
People also viewed…


The discount calculator uses a product's original price and discount percentage to find the final price and the amount you save.

Pizza size

Make the best pizza choice with our Pizza Size Calculator – compare sizes and prices for the perfect order!

TV mounting height

Use the TV mount height calculator to find out how high to hang a TV. Additionally, you can estimate the ideal TV height for any tilt angle.

Tip from net price

Use the tip from net price calculator to find out how much you should tip if you don't take taxes into account.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service