Python: ipaddress
Standard-library IPv4 and IPv6 parsing, networks and membership checks.
Network tool
Remove duplicate and contained networks, combine adjacent sibling networks, and find exactly where your input CIDRs overlap. The merged output covers the same addresses as your input.
Try adjacent and overlapping networks
3 input entries → 1 merged networks. 0 entries had host bits normalized to their network address.
192.0.2.0/24
Numbers identify original input positions. Duplicates count as overlaps; adjacent networks do not. Each intersection is the narrower of the two CIDRs.
| First entry | Second entry | Intersection |
|---|---|---|
| 1: 192.0.2.0/25 | 3: 192.0.2.64/26 | 192.0.2.64/26 |
192.0.2.0/25 and 192.0.2.128/25 are siblings, so they merge into 192.0.2.0/24. Adding 192.0.2.64/26 changes nothing in that merged result: it is already covered, but is reported as overlapping the first input.
192.0.2.0/26 and 192.0.2.128/26 remain separate. Combining them into one larger CIDR would introduce addresses you did not supply. This tool never fills such gaps.
Merging is useful for address inventories and rules that all have the same action. A firewall may also depend on rule order, ports, protocols, or allow/deny actions. Those settings are not part of this calculation: do not combine rules with different meanings just because their address ranges overlap.
Host bits are normalized: 192.0.2.17/24 becomes 192.0.2.0/24. A single IPv4 address needs /32 and a single IPv6 address needs /128. IPv4-mapped IPv6 prefixes are rejected to avoid ambiguity; write those networks in IPv4 notation.
See the CIDR guide for prefix notation, or use range to CIDR for a start and end address. CIDR aggregation is described in RFC 4632. Inputs are submitted to ShowIP and included in your browser URL; see the privacy policy.
Build the same kind of checks into your code using these documented libraries.
Standard-library IPv4 and IPv6 parsing, networks and membership checks.
Standard-library address and prefix types with Contains and Overlaps methods.
A third-party library for IPv4/IPv6 parsing and CIDR matching.
Next steps
Advertisement