IPv4 Range to CIDR
Turn a start and end IP address into the shortest list of CIDR blocks — perfect for firewall rules, ACLs and allow-lists — and find the single network that covers the whole range.
How to use the IPv4 Range to CIDR
- Enter the first and last IP address — or paste a range like 10.0.0.1 - 10.0.3.255.
- Read the exact CIDR blocks and the number of addresses.
- Press Copy list to paste the blocks into your firewall.
Tips
- Ranges that start on a block boundary need fewer CIDR entries.
- Use the covering network only when extra addresses in your rule are acceptable.
Frequently asked questions
How do I convert an IP range to CIDR?
Enter the first and last address. The calculator lists the minimum set of CIDR blocks that exactly cover the range.
Why are there several blocks?
A CIDR block must start on a power-of-two boundary, so most ranges need several blocks.
What is the covering network?
The smallest single CIDR that contains the whole range — it may include extra addresses.
Can I paste a range with a dash?
Yes, paste it into the first box, e.g. 192.168.1.10-192.168.1.130.
Is anything sent to a server?
No. All calculations run in your browser on your own device.
Worked example: a range to the fewest CIDR blocks
Firewalls usually accept CIDR blocks, not ranges. Here is how the range 10.0.0.5 to 10.0.0.20 (16 addresses) breaks down:
| CIDR block | Covers | Addresses |
|---|---|---|
| 10.0.0.5/32 | 10.0.0.5 | 1 |
| 10.0.0.6/31 | 10.0.0.6 – 10.0.0.7 | 2 |
| 10.0.0.8/29 | 10.0.0.8 – 10.0.0.15 | 8 |
| 10.0.0.16/30 | 10.0.0.16 – 10.0.0.19 | 4 |
| 10.0.0.20/32 | 10.0.0.20 | 1 |
Five blocks cover exactly these 16 addresses and nothing else. The single network that covers the whole range is 10.0.0.0/27, but it also includes 16 extra addresses (10.0.0.0–10.0.0.4 and 10.0.0.21–10.0.0.31).
Exact list or one bigger block?
- Allow-lists (who may reach a server): use the exact list. A bigger block lets in addresses you did not mean to trust.
- Block-lists (keeping an attacker out): a slightly bigger block is often fine and keeps the rule short.
Why blocks start where they do
A CIDR block of size 8 must start on a multiple of 8, a block of 4 on a multiple of 4, and so on. That is why a range that starts on an odd address like .5 always needs small blocks at the edges. Ranges that start and end on round boundaries, like .0 to .255, fit in a single block.