Skip to content
SubnettingCalculator
IPv4 Detecting…
IPv6 Detecting…

IP Range to CIDR – Convert IPv4 Ranges to CIDR Blocks

Use this free IP range to CIDR converter to turn a start and end IPv4 address into the shortest list of CIDR blocks that covers the range exactly. Paste one range per line, or many at once, and copy the CIDR list for your firewall, access list or cloud security group.

IP Range to CIDR Converter

Enter one range per line, from the first IP to the last IP.

IP Ranges to Convert

Example Input:
192.168.1.10 - 192.168.1.200 10.0.0.0 - 10.0.3.255 172.16.5.1 to 172.16.5.9 203.0.113.77
Options:

What is an IP range to CIDR converter?

An IP range is a start address and an end address, like 192.168.1.10 to 192.168.1.200. Firewalls, routers and cloud security groups usually do not take ranges. They take CIDR blocks, such as 192.168.1.0/24. This converter turns a range into the CIDR blocks that cover it.

Most ranges do not match a single block, so one range often becomes several blocks. The converter finds the shortest list, and the blocks cover your range exactly, with no extra addresses.

How to use the IP Range to CIDR converter

1Enter your ranges

Type or paste the ranges into Enter IP Ranges, one per line, like 192.168.1.10 - 192.168.1.200. You can also write to or a comma between the two addresses. A single address gives a /32, and a line that is already CIDR is kept as it is. Click Copy Example if you want a sample to paste in and try.

2Choose the options

Tick Merge overlapping and touching ranges first if your list may have ranges that overlap or sit side by side. They are joined into one range before converting, so you get fewer blocks.

3Click Convert to CIDR

The result appears below the form. From then on it follows your changes, so you can edit a range and watch the blocks update. If a line has a problem, a red message names the line.

4Read the result

The CIDR Blocks table shows each block with its network address, usable range, broadcast address, size and masks. Tick or untick boxes in Show Columns to choose what you see. On a phone or tablet that row slides sideways. The CIDR List box under it holds only the blocks, one per line.

5Copy, download or start again

Copy puts the table on your clipboard and Download saves it as a CSV file, using only the columns you ticked. Copy List copies just the CIDR blocks. Clear All empties the box and puts the options back to their defaults.

Common slip-ups

  • "The start IP is higher than the end IP". Swap the two addresses.
  • Two ranges on one line. Put each range on its own line.
  • Repeated blocks in the result. Your ranges overlap and Merge is off. Tick the Merge option.

How a range is turned into CIDR blocks

A CIDR block has two rules: it holds a power of 2 addresses, and it starts on an address that is a multiple of its own size. The converter starts at the first address of the range and repeats these steps:

  1. Find the biggest block that can start at this address. That depends on how many zero bits the address ends with.
  2. Find the biggest block that still fits in what is left of the range.
  3. Take the smaller of the two as the next block, and move to the address right after it.

It stops when the end of the range is reached. Because it always takes the biggest block possible, the list is as short as it can be.

Example 1: a range that needs several blocks

192.168.1.10 - 192.168.1.200 is 191 addresses and gives 8 blocks:

CIDR BlockNetwork AddressBroadcast AddressTotal IPs
192.168.1.10/31192.168.1.10–2
192.168.1.12/30192.168.1.12192.168.1.154
192.168.1.16/28192.168.1.16192.168.1.3116
192.168.1.32/27192.168.1.32192.168.1.6332
192.168.1.64/26192.168.1.64192.168.1.12764
192.168.1.128/26192.168.1.128192.168.1.19164
192.168.1.192/29192.168.1.192192.168.1.1998
192.168.1.200/32192.168.1.200–1

The start .10 is not a multiple of a big number, so the first blocks are small. This is also why a block can start after your first IP: 192.168.1.12/30 is the block that begins at .12, and .10 and .11 sit in the /31 before it. They grow as the addresses line up, and then shrink again near the end.

Example 2: a range that is one block

10.0.0.0 - 10.0.3.255 starts on a boundary and holds exactly 1,024 addresses, so it gives 1 block: 10.0.0.0/22.

When it helps

Use it when a vendor, a threat report or a country list gives you ranges but your firewall or cloud console wants CIDR. It is also useful for allow lists, blocklists, security group rules and routing filters. To go the other way and join networks into one summary, use the Supernetting Calculator.

Frequently asked questions

What does an IP range to CIDR converter do?

It turns a range such as 192.168.1.10 - 192.168.1.200 into CIDR blocks such as 192.168.1.10/31. CIDR blocks are what firewalls, routers, cloud security groups and allow lists understand.

Why does one range give several CIDR blocks?

A CIDR block must start on an address that fits its size and must hold a power of 2 addresses. Most ranges do not line up that neatly, so they are cut into several blocks. A range like 10.0.0.0 - 10.0.3.255 does line up, and gives one /22.

Is the result the shortest possible list?

Yes. The converter always takes the biggest block that starts on the current address and still fits inside the range, so it uses as few blocks as possible. The blocks cover your range exactly. No address outside the range is included.

Which input formats work?

One range per line. Write it as start - end, start to end, start,end or start end. A single address such as 203.0.113.77 gives a /32, and a line that is already CIDR, such as 10.0.0.0/24, is kept. Lines that start with # are ignored.

What does the Merge option do?

When it is ticked, overlapping ranges and ranges that touch each other are joined into one before converting. 10.0.0.0 - 10.0.0.255 and 10.0.1.0 - 10.0.1.255 become one range, and then one /23. With Merge off, each range is converted on its own.

What if the start IP is higher than the end IP?

The converter shows an error for that line instead of guessing. Swap the two addresses and try again.

How can I use the CIDR list?

Copy it into a firewall rule, an access list, a cloud security group, a blocklist or an allow list. The CIDR List box has one block per line, and Download saves the full table as a CSV file.

Can I convert CIDR back to a range?

Yes. Each block row shows its network address, usable range, broadcast address and host counts. For a single subnet, the IPv4 Subnet Calculator shows the same details, and the Subnet IP List Generator lists every address.

Does it support IPv6 ranges?

Not yet. This converter is for IPv4 ranges.

Is anything I enter sent to your server?

No. The conversion runs in your browser, so your ranges stay on your device.