How to use the cidr aggregator
- Paste a list of addresses, CIDR blocks and ranges, one per line. IPv4 and IPv6 can be mixed, and text after a # on a line is ignored.
- Write a range as start - end, such as 203.0.113.5 - 203.0.113.40. A bare address counts as a single address.
- Choose whether to get the result as CIDR blocks or as address ranges.
- Copy the merged list or download it. Lines that are not valid are reported with their line number.
Exact merging
The tool merges overlapping and touching blocks and then writes the result as the fewest CIDR blocks that cover exactly the same addresses. It never adds an address that was not in your input. That matters for firewall rules and allow lists, where a block that is too wide can open more than you meant.
The sample list has 8 lines. The three IPv4 10.0.x blocks merge into 10.0.0.0/22, 192.168.1.17 joins 192.168.1.16/31, the range 203.0.113.5 to 203.0.113.40 breaks into 8 blocks, and the two IPv6 halves merge into 2001:db8::/32. The IPv4 part covers 1,062 addresses.
How it works
Every entry becomes a range with a start and an end address. The ranges of each family are sorted and joined when one starts at or before the address right after the previous one ends. Each merged range is then cut into the largest aligned blocks, starting from the lowest address, which gives the smallest list for that range.
IPv6 addresses use arbitrary-size integers, so full 128 bit ranges are exact. An address with host bits set, such as 10.0.0.5/24, is treated as the whole network 10.0.0.0/24 and the tool notes it. Use the Subnet Calculator to inspect a single block, the VLSM Subnet Planner to plan address space, and the IP Address Format Converter to change how an address is written.
Limits and privacy
Up to 20,000 lines are read. Addresses with zone ids, embedded IPv4 in IPv6 and leading zeros in IPv4 parts are rejected as invalid, to avoid readings that differ between systems. The list stays in your browser and is not uploaded.
A merged list is easier to review and fits more rules in a device with a limit. Check the result before you deploy it, and keep the original list. Port numbers for services are in the Common Ports List.
Assumptions and limits
- Each line holds one address, one CIDR block or one range, in IPv4 or IPv6.
- Merging is exact. The output covers the same addresses as the input and no others.
- Entries are not checked against any registry, and private or reserved ranges are treated like any others.
- The tool changes how a list is written. It does not judge whether a block should be allowed.
Frequently asked questions
What is CIDR aggregation?
It is combining address blocks into fewer, larger ones when they are next to each other or overlap. Two /24 blocks that are neighbors and line up on a /23 boundary become one /23 block.
Why can some neighbors not be merged into one block?
A CIDR block must start at a multiple of its own size. Two /24 blocks that sit side by side but straddle a /23 boundary cover a continuous range but cannot be written as one /23, so they stay two blocks.
Does it ever add addresses that were not in my list?
No. The output covers exactly the addresses you gave. Some tools offer a covering mode that widens blocks, but that can open addresses you did not intend, so this tool does not do it.
Can I paste a range instead of blocks?
Yes. Write it as the first address, a hyphen and the last address. The range is split into the fewest blocks that cover it exactly.