CIDR Merge & IP Range to CIDR
Merge and deduplicate IP lists into the fewest CIDR blocks, subtract ranges, and convert IP ranges to CIDR
The merged list appears here.Overlapping and touching blocks are joined, duplicates disappear, and every range becomes the smallest set of CIDR blocks that covers it exactly. IPv4 only. To inspect a single block, use the CIDR Calculator; to split one into subnets by size, the VLSM Subnet Planner.
Was the CIDR Merge & IP Range to CIDR helpful?
About this tool
CIDR Merge cleans up IP lists. Paste IP addresses, CIDR blocks, ranges like 10.0.0.1-10.0.0.50 or address/mask pairs — in any mix, separated by new lines or commas — and it merges overlapping and touching entries, removes duplicates and rewrites everything as the fewest CIDR blocks that cover exactly the same addresses. Add entries to the Exclude box to subtract them, for example to allow a whole /16 except one subnet. Every IP range is converted to the minimal list of CIDR blocks, which is what firewalls, security groups, nginx allow rules and cloud allowlists expect. It works with IPv4 and runs entirely in your browser.
When to use it
- →Converting an IP range from a vendor or ISP into CIDR blocks
- →Shrinking a long firewall or security-group allowlist
- →Combining IP lists from several sources without duplicates
- →Allowing a large network except for a few subnets
- →Checking how many addresses a list really covers
Tips
- ◆Ranges rarely line up with block boundaries, so one range often becomes several CIDR blocks — that's expected.
- ◆Lines starting with # are ignored, so you can paste commented allowlists.
- ◆Switch the output to start–end ranges for tools that want ranges instead of CIDR.
Frequently asked questions
How do I convert an IP range to CIDR?
Paste the range (for example 192.168.1.10 - 192.168.1.20) and the tool returns the smallest set of CIDR blocks that covers exactly those addresses — here 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32.
Why does my range need several CIDR blocks?
A CIDR block always has a power-of-two size and starts on a matching boundary. A range that doesn't fit one block exactly is split into the fewest blocks that do.
Does it support IPv6?
Not yet — it handles IPv4 addresses, ranges and blocks.