IP Range to CIDR Converter — The Minimal Block List for ACLs
Convert start–end IPv4 boundaries into exact minimal CIDR prefixes for ACLs.
| Input | Blocks | Minimal CIDRs |
|---|---|---|
192.168.1.10 - 192.168.1.50 | 6 | 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/28, 192.168.1.48/31, 192.168.1.50/32 |
10.0.0.0 - 10.0.3.255 | 1 | 10.0.0.0/22 |
203.0.113.100-203.0.113.200 | 6 | 203.0.113.100/30, 203.0.113.104/29, 203.0.113.112/28, 203.0.113.128/26, 203.0.113.192/29, 203.0.113.200/32 |
2001:db8::1 - 2001:db8::ff | 8 | 2001:db8::1/128, 2001:db8::2/127, 2001:db8::4/126, 2001:db8::8/125, 2001:db8::10/124, 2001:db8::20/123, 2001:db8::40/122, 2001:db8::80/121 |
When to use the First–Last IP Range to Minimal Covering CIDR Converter
As few blocks as possible
Ranges such as 192.168.1.10 to 192.168.1.50 rarely line up with one prefix. The tool works out the smallest CIDR set covering exactly that range, no more and no less.
For firewalls and ACLs
Many firewalls, cloud security groups and router ACLs only accept CIDR notation. The result can be pasted straight in as a rule list.
Many ranges at once
Write one range per line separated by a hyphen or space, IPv4 or IPv6, then copy or download all the resulting blocks. Invalid lines are flagged and left out of the result.
A tested algorithm
Results are compared with summarize_address_range from Python's standard library on thousands of random ranges, and all of them match.
Frequently asked questions
Why is the result more than one block?
CIDR blocks are always a power of two in size and must start on a multiple of their size, so unaligned ranges split into several blocks.
What about ranges from WHOIS?
ARIN WHOIS NetRange or APNIC inetnum ranges can be pasted directly in start - end form.
Is IPv6 supported?
Yes, as long as the start and end belong to the same address family. Long IPv6 ranges are split into minimal blocks the same way.
How do I merge results from several ranges?
Paste all blocks into the CIDR Aggregator to merge adjacent or overlapping ones.
Is my data sent to a server?
No. Everything is computed in your browser, so internal ranges and partner lists never leave your device.
Similar tools
- CIDR Block to First–Last Usable IP Range ConverterExpand any /0–/32 CIDR notation into network, broadcast & total host count.
- CIDR Exclusion & WireGuard AllowedIPs BuilderSubtract LAN or private ranges from 0.0.0.0/0 or any block and get the minimal CIDR list for WireGuard, routing or MikroTik.
- CIDR & IP Range to Full Address List ExpanderExpand IPv4/IPv6 CIDRs and start–end ranges into every individual address, ready to export as TXT for scanners and ACLs.
- IP / CIDR List Diff & Allowlist AuditorCompare two IP/CIDR lists by real address coverage: what was added, removed, or overlaps — ideal for firewall allowlist reviews.