CIDR Overlap

Compute intersection between two sets of CIDRs/ranges.

About This Tool

The CIDR Overlap Detector calculates the intersection between two sets of CIDR blocks or IP ranges, identifying which addresses exist in both sets. This tool is critical for detecting IP address conflicts, validating network design, ensuring non-overlapping subnet allocations, and troubleshooting routing issues. It supports both IPv4 and IPv6, handles multiple CIDR inputs per set, and provides a clear yes/no overlap indicator along with the specific overlapping address ranges expressed as minimal CIDR blocks.

How to Use

  1. Enter one or more CIDR blocks in Set A, one per line
  2. Enter one or more CIDR blocks in Set B, one per line
  3. Enable "Merge inputs" (recommended) to consolidate overlapping ranges before comparison
  4. Click "Compute" to calculate the intersection
  5. Check the "Overlap" indicator to see if any addresses exist in both sets
  6. View the specific overlapping CIDR blocks in the IPv4 and IPv6 results
  7. Empty results (—) indicate no overlap for that IP version

Features

  • Calculates intersection (overlap) between two CIDR sets
  • Clear yes/no overlap detection
  • Shows specific overlapping address ranges as CIDR blocks
  • Supports both IPv4 and IPv6 addresses
  • Handles multiple CIDR blocks per set
  • Optional merge mode for cleaner results
  • Minimal CIDR representation of overlapping ranges
  • Separate output for IPv4 and IPv6 results

Common Use Cases

  • Detecting IP address conflicts before subnet allocation
  • Validating non-overlapping VLANs or security zones
  • Troubleshooting routing issues caused by overlapping routes
  • Verifying cloud VPC peering doesn't have conflicting ranges
  • Checking for conflicts between on-premises and cloud networks
  • Auditing firewall rules for overlapping address definitions
  • Preventing duplicate IP assignments across network segments
  • Validating network mergers and acquisitions for address conflicts
  • Ensuring split-horizon DNS zones don't have overlapping ranges
  • Testing subnet design before implementation

Technical Details

CIDR overlap detection computes the intersection of two IP address sets, returning the addresses that appear in both Set A and Set B. The result is expressed as the minimal set of CIDR blocks covering the overlapping space.

Basic Overlap Example:

  • Set A: 192.168.1.0/25 (addresses .0 to .127)
  • Set B: 192.168.1.64/26 (addresses .64 to .127)
  • Overlap: 192.168.1.64/26 (64 addresses in common: .64 to .127)
  • Overlap exists: Yes

No Overlap Example:

  • Set A: 10.0.0.0/24
  • Set B: 10.0.1.0/24
  • Overlap: None (disjoint ranges)
  • Overlap exists: No

Merge Option:

When "Merge inputs" is enabled (recommended), the tool first consolidates overlapping ranges within each set before computing the intersection:

  • Without merge: Set A with 192.168.1.0/25 and 192.168.1.64/26 is treated as two separate blocks
  • With merge: These are first combined into 192.168.1.0/25 (since /26 is contained in /25)
  • Result: Cleaner output and more accurate representation of the actual overlap

Algorithm Steps:

  1. Parse and validate all CIDR blocks in both sets
  2. Optionally merge overlapping ranges within each set
  3. Expand sets to their constituent IP addresses
  4. Compute set intersection (addresses present in both A and B)
  5. Convert intersection back to minimal CIDR representation
  6. Separate results by IPv4 and IPv6

Practical Applications:

Overlap detection is essential for preventing address conflicts in network design. Common scenarios include validating that VPC peering connections have non-overlapping CIDR blocks (AWS requirement), ensuring branch office subnets don't conflict with headquarters, and verifying that DMZ networks are properly isolated from internal networks.