CIDR Aggregator
Aggregate a list of IP addresses or subnets into the minimal set of CIDR blocks. Optimize firewall rules and routing tables.
CalculatorAggregated CIDR Blocks
Skipped Lines (invalid)
CIDR Aggregation Rules
- Adjacent blocks with the same prefix length merge if they form a valid supernet (e.g., 10.0.0.0/24 + 10.0.1.0/24 = 10.0.0.0/23).
- Overlapping blocks are collapsed into the smallest covering block.
- Single IP addresses are treated as /32 host routes.
- The algorithm repeats until no further merges are possible.
How to Use
-
1
Enter IP Addresses or CIDR Blocks
Paste a list of IP addresses or CIDR blocks, one per line. The tool accepts mixed input including individual IPs (interpreted as /32 for IPv4 or /128 for IPv6), CIDR blocks of any prefix length, and combinations of both.
-
2
Run Aggregation
Click aggregate to compute the minimal set of CIDR blocks that covers exactly the same address space as the input. The algorithm merges adjacent and overlapping blocks into the fewest, largest possible CIDR blocks without including addresses not in the input set.
-
3
Apply Results to Network Configuration
Use the aggregated CIDR list in firewall rules, routing configurations, or access control lists. Fewer, larger CIDR blocks reduce rule counts in firewall and router configurations, improving performance and reducing management complexity.
About
CIDR aggregation is an optimization technique that reduces complex sets of IP address ranges to their minimal CIDR representation, finding applications in network security operations, routing protocol management, and network policy administration. As IP address lists grow — whether from threat intelligence feeds listing malicious IP ranges, allowlists for trusted partner networks, or network segmentation policies — managing individual addresses becomes impractical. Aggregation tools provide the computational mechanism to collapse these lists while preserving their coverage, enabling more efficient policy implementation.
The mathematical basis of CIDR aggregation is rooted in the binary tree structure of IP address space. IPv4's 32-bit address space can be visualized as a binary tree where each level represents one bit of the address. A CIDR block corresponds to a subtree rooted at the node identified by the network prefix bits. Two adjacent, same-size CIDR blocks that share a parent node in this tree can be replaced by their parent, a block twice as large with one fewer prefix bit. The aggregation algorithm traverses this tree bottom-up, merging siblings wherever possible. This process is analogous to the Karnaugh map minimization used in digital logic design.
Practical applications of CIDR aggregation span multiple network operations disciplines. Security teams maintaining IP reputation lists and geographic blocking rules benefit from aggregated lists that can be loaded into firewall memory more efficiently. Network operations centers use aggregation when planning route advertisements to ensure customers aren't accidentally leaking more-specific routes that should be aggregated. Cloud platform engineers aggregate VPC subnet ranges for transit gateway routing tables and security group rules. DevOps engineers working with CDN and DDoS protection services aggregate IP allowlists for origin server access policies. In all these cases, the goal is the same: represent the desired address space as efficiently as possible without sacrificing correctness.