CIDR overlap check
Paste a list of CIDR blocks or ranges to find every pair that shares addresses: identical, one inside the other, or a partial overlap. Get a clean list without overlaps.
Overlapping pairs
3 pairs among 6 itemsExample: paste your own list above.
| A | B | Relation | Shared addresses |
|---|---|---|---|
| 10.0.0.0/8 (line 1) | 10.20.0.0/16 (line 2) | A contains B | 10.20.0.0-10.20.255.255 (65,536) |
| 192.0.2.0/24 (line 3) | 192.0.2.128/25 (line 4) | A contains B | 192.0.2.128-192.0.2.255 (128) |
| 198.51.100.0/24 (line 5) | 198.51.100.0/24 (line 6) | Identical | 198.51.100.0-198.51.100.255 (256) |
- A
- 10.0.0.0/8 (line 1)
- B
- 10.20.0.0/16 (line 2)
- Relation
- A contains B
- Shared addresses
- 10.20.0.0-10.20.255.255 (65,536)
- A
- 192.0.2.0/24 (line 3)
- B
- 192.0.2.128/25 (line 4)
- Relation
- A contains B
- Shared addresses
- 192.0.2.128-192.0.2.255 (128)
- A
- 198.51.100.0/24 (line 5)
- B
- 198.51.100.0/24 (line 6)
- Relation
- Identical
- Shared addresses
- 198.51.100.0-198.51.100.255 (256)
Cleaned list
3 blocks, no overlaps10.0.0.0/8 192.0.2.0/24 198.51.100.0/24
The cleaned list covers exactly the same addresses as yours. Blocks that sit side by side are merged too.
How it works
Two blocks overlap when they share at least one address. There are three ways that can happen. They can be identical, like the same rule pasted twice. One can contain the other, like 10.0.0.0/8 and 10.20.0.0/16. Or, for ranges that aren't CIDR blocks, they can partly overlap. Two CIDR blocks never partly overlap: either one holds the other or they share nothing.
In firewall rules and mail server allowlists, overlaps are usually harmless but untidy. A rule inside a wider rule never fires on its own, and removing the wider one later can change more than you expect.
When you plan cloud networks (VPCs) or VPN tunnels, overlaps are a real problem. Two networks with overlapping ranges can't be peered or routed to each other, because a router can't tell which side an address belongs to. Check the plan before you build it.
The cleaned list is the same as the CIDR aggregator gives. To check single addresses against a list, use the IP in range check.