CIDR Range Merger

Paste a list of IPv4 CIDR blocks (one per line) and get back the smallest disjoint set that covers the same address space. Useful for firewall rule reviews, route aggregation, and inventory cleanup. Adjacent and overlapping blocks collapse into their smallest containing supernet; duplicates drop out. Per-line validation shows exactly which lines parsed. Pure client-side, no upload.

Per-line results

0 line(s) parsed, 0 invalid.

# Input Status Normalized CIDR First Last Addresses

Merged result

0 CIDR(s) covering 0 address(es), 0 usable host(s).

How it works

The merger runs the classic route-aggregation sweep. For every valid line it normalizes the CIDR to its network address, sorts by (network, prefix), then walks the list asking “can the current block and the next be combined into a single supernet at some shorter prefix?” Adjacent sibling blocks and strict-subnet blocks absorb up; non-adjacent blocks stay separate. The output is the minimal disjoint set that covers the same addresses — the answer you’d compute by hand with a binary trie, automated. References: RFC 4632 (CIDR), RFC 4291, RFC 1812 §5.2.4.

Usable-host counts respect RFC 3021: a /31 has 2 usable hosts (no broadcast, no network), a /32 has 1, and all other prefixes lose 2 to network + broadcast.