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
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.
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.
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.
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.
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:
- Find the biggest block that can start at this address. That depends on how many zero bits the address ends with.
- Find the biggest block that still fits in what is left of the range.
- 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 Block | Network Address | Broadcast Address | Total IPs |
|---|---|---|---|
| 192.168.1.10/31 | 192.168.1.10 | – | 2 |
| 192.168.1.12/30 | 192.168.1.12 | 192.168.1.15 | 4 |
| 192.168.1.16/28 | 192.168.1.16 | 192.168.1.31 | 16 |
| 192.168.1.32/27 | 192.168.1.32 | 192.168.1.63 | 32 |
| 192.168.1.64/26 | 192.168.1.64 | 192.168.1.127 | 64 |
| 192.168.1.128/26 | 192.168.1.128 | 192.168.1.191 | 64 |
| 192.168.1.192/29 | 192.168.1.192 | 192.168.1.199 | 8 |
| 192.168.1.200/32 | 192.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.