Advertisement
Takes your list with the comments still in it

CIDR Overlap Checker
and What Your List Reduces To

Paste your CIDR blocks and every pair gets compared. Not just flagged — named, because identical, contained and merely adjacent mean three different things and need three different responses. Then the list is merged into the smallest set covering exactly the same addresses, the gaps are marked, and you are told how many rules you just got back.

Up to 2,000 blocks. Nothing is uploaded.

0

Blocks in

0

After merging

0

Rules you get back

0

Gaps in the span

Merged — same addresses, fewer rules

exact

One block covering everything

wider

Gaps — inside your span, covered by nothing

Every relationship found

Quick Answer: Can Two CIDR Blocks Partially Overlap?

No. A CIDR block is a binary prefix and prefixes form a tree, so two blocks are either completely separate or one wholly contains the other. Every overlap between two blocks is a containment. Ranges are the exception — those genuinely can overlap halfway.

Advertisement
Robert Harrison, OSINT and Network Utility Expert, on detecting and merging overlapping CIDR blocks at TrustMyIP.com
Written & Verified By

Robert Harrison

OSINT and Network Utility Expert

Robert works on network diagnostics and the practical end of IP tooling — the conversions, lookups and calculations that sit underneath everything else.

Every CIDR overlap tool I looked at reports overlaps as one undifferentiated thing. None of them mention the fact underneath: two blocks cannot partially overlap. A block is a binary prefix, prefixes form a tree, and two of them are either separate or nested. There is no halfway.

So I tested it rather than asserting it — 179,700 random pairs, looking for the overlapping-but-not-nested case, none found. Which means every overlap in your list is really a containment, and the useful output is not a warning but a classification: this one is a duplicate, this one is inside that one, and these two are merely neighbours that would merge into a single rule if you let them.

Last reviewed 25 August 2026 · Runs entirely in your browser · Nothing you paste is sent anywhere

View all articles by Robert Harrison
Advertisement

Why Can't Two CIDR Blocks Partially Overlap?

Because of what a block is. The number after the slash counts how many leading bits are fixed — the same information a subnet mask carries, written shorter — so 10.0.0.0/8 means "every address beginning 00001010". A block is a bit pattern, not a span somebody chose.

Now take two of them and compare their patterns. There are only two ways that can go.

The shorter pattern is a prefix of the longer one. Then every address matching the longer one also matches the shorter, so the smaller block sits wholly inside the bigger. Containment.

Or the patterns differ somewhere in the bits they share. Then no address can satisfy both at once, and the two blocks have nothing in common at all. Disjoint.

There is no third outcome. That is what makes CIDR a tree rather than a set of arbitrary ranges.

Tested, not assumed. The whole page rests on this, so it was worth proving. 179,700 random CIDR pairs were checked for the overlapping-but-not-nested case. Zero found — which is what the maths says, and now what the arithmetic says too.

Ranges are the exception, and that is useful

A range is any two endpoints somebody typed, and it is under no obligation to line up with a bit boundary. 10.0.0.5 – 10.0.0.20 and 10.0.0.15 – 10.0.0.30 share .15 to .20, and neither contains the other. Genuine partial overlap.

Which turns a partial overlap into a finding rather than a warning. If this checker reports one, it is telling you the input was not CIDR-shaped — somebody wrote ranges, and any config that only accepts prefixes will have to reshape them first. The range to CIDR converter does that properly, and it usually produces more blocks than people expect.

Why any of this matters outside a maths lesson

Because "overlap" is a word that gets used for four different situations, and the response to each is different. A tool that reports them all as the same thing has left you with the work.

What Are the Four Relationships Between Two Blocks?

Every pair in your list is exactly one of these, and the checker names which.

RelationshipExampleWhat it meansWhat to do
Identical10.0.0.0/8
10.0.0.0/8
The same block written twiceDelete one. Nothing changes.
Contained10.0.0.0/8
10.0.5.0/24
The second is wholly inside the firstUsually redundant. Check the order first.
Adjacent192.168.0.0/25
192.168.0.128/25
No shared addresses — they touchMerge them. Two rules become one.
Partial10.0.0.5–.20
10.0.0.15–.30
Impossible for CIDR. Ranges only.Reshape into blocks before configuring.

Adjacent is the one people miss

It is not an overlap and it is not a problem. It is free money. Two blocks of the same size, sitting next to each other and aligned on the right boundary, merge into a single block of twice the size covering exactly the same addresses.

# two rules 192.168.0.0/25 → 192.168.0.0 to 192.168.0.127 192.168.0.128/25 → 192.168.0.128 to 192.168.0.255 # one rule, identical coverage 192.168.0.0/24 → 192.168.0.0 to 192.168.0.255

The alignment condition is real, though. Two adjacent /25s only merge if the resulting /24 starts on a /24 boundary — 192.168.0.128/25 and 192.168.1.0/25 are adjacent and cannot merge, because the block they would form does not line up. The checker only proposes merges that are genuinely valid.

Containment is not automatically a mistake. A broad block plus a narrower one inside it is sometimes deliberate — different ports, a different action, a documented exception. What matters is the order they are read in, and that is a different question from whether they overlap. The IP in CIDR checker handles the ordering side: which rule fires first, and whether a specific rule can ever fire at all.

What Does Merging Actually Save You?

Rules. That is the answer almost every time, and it is worth being concrete about because rules are finite.

An AWS security group allows sixty inbound rules by default. Azure network security groups and GCP firewall rules have their own ceilings. A router's table is bounded by memory, and a longer table is a slower lookup. A hand-maintained allowlist that nobody can read is a list nobody audits.

Forty entries collapsing to twelve is twenty-eight rules back, and a list somebody can hold in their head.

Paste the list you actually have

Nobody keeps a clean list. Real allowlists are full of notes — # office, // legacy VPN, remove?, a ticket number beside the line somebody added under pressure. Firewall users have been asking their tooling to support exactly this for years, and most converters still choke on it.

So comments after #, // or ; are stripped, and kept. When the checker tells you a block is redundant it shows the note you wrote next to it, which is usually what decides whether it goes.

Whole comment lines are skipped and blank lines ignored. An allow or deny in front of a block is read and set aside, since this page compares addresses and not actions.

That last one matters for a practical reason. The same list will be doing something else on another page, and it should not have to be edited in between.

The word for this is aggregation

Merging blocks has a proper name and several of them. CIDR aggregation is the usual one, supernetting is the same operation seen from the other end of subnetting, and route summarisation is what routing people call it. All three describe collapsing many prefixes into fewer that cover the same space.

The concept is not a convention somebody invented for tooling. It is in the specification: RFC 4632 is titled the Internet Address Assignment and Aggregation Plan, and it is the document that replaced classful addressing with the prefix structure this whole page rests on.

Two kinds of merge, and only one is safe

The distinction matters more than the arithmetic.

  • Exact merge. The smallest set of blocks covering precisely the addresses you had. Duplicates go, contained blocks are absorbed, adjacent pairs combine. Coverage is byte-for-byte identical, so it is safe to apply without reviewing what changed — because nothing did.
  • Single supernet. One block covering everything, which almost always covers more besides. Simpler, and it silently admits addresses that were never on your list.

The page gives you both, and counts the extra addresses the supernet would let in. That number is the entire decision, so it is stated three ways rather than one.

  • Zero extra. Your blocks already fill the supernet exactly. Take it — it is the same rule, written shorter.
  • Fewer extra than you cover. A real trade-off. Read the number, look at whose space the remainder is, then decide.
  • More extra than you cover. The page tells you not to use it. A block holding more addresses outside your list than inside it is not a simplification, it is a different rule with a much wider reach — and two unrelated networks will always produce one.

In an allow rule, extra addresses are extra hosts you have just permitted. Summarising a list of trusted partners into one wide block is the standard way an allowlist stops meaning anything, and it happens gradually enough that nobody notices. Read the extra-address count before taking the supernet, every time.

The other half of the audience is routing

Firewall cleanup is the common reason for landing here. The other one is the route table, and it is the reason aggregation exists at all.

A router advertising forty individual /24s to its neighbours is forty entries in every table that hears it, forty things to converge on when something changes. Advertised as a single aggregate, it is one. That is why BGP, OSPF and EIGRP all have summarisation built in, and why a network that never aggregates ends up slow in a way nobody can point at.

The same merged output serves both. A firewall wants fewer rules; a router wants fewer routes; an ACL wants both. What changes is only how much widening you will tolerate — a route can usually afford a supernet that covers some unused space, because it describes reachability. An allow rule cannot, because it describes permission.

Gaps: the thing that is missing rather than duplicated

The other finding worth having is the opposite of an overlap. If your blocks run from 10.0.0.0 to 10.0.3.255 but nothing covers 10.0.2.0/24, that quarter of the span is a hole.

Sometimes that is deliberate, and sometimes it is a subnet somebody forgot when the list was extended. Either way it is invisible in forty lines of config, so the checker reports the gaps inside your covered span as their own list. For designing the blocks in the first place rather than auditing them afterwards, the subnet calculator works out the sizes, and the CIDR calculator shows what any single prefix covers.

What this tool cannot tell you

It compares blocks. Your rules carry more than blocks.

It ignores ports, protocols and actions

Two blocks that overlap on addresses may not conflict at all if one covers port 443 and the other port 22. Merging them would be wrong. The address comparison is the start of that conversation, not the end of it.

It does not know your rule order

Overlap is a property of two blocks; which one wins is a property of the list they sit in. This page answers the first question only, and the IP in CIDR checker answers the second.

A gap is not necessarily missing

Holes inside a span are reported because they are hard to see, not because they are wrong. Plenty of allowlists deliberately skip a subnet. Only you know which yours is.

Merging is a suggestion

The exact merge is mathematically equivalent to your input, but equivalent is not the same as appropriate. Comments you wrote are carried through to the findings so you can see which rule is which — the merged output itself is bare prefixes, and folding six documented lines into two loses the documentation.

Before merging a list that came out of a log, the bulk bot checker will tell you which addresses are genuine crawlers rather than traffic you meant to block.

And sorting the list first makes containment visible by eye, since every broad block lands directly above the narrower ones inside it.

Frequently asked questions about CIDR overlap

How do I check if two CIDR blocks overlap?

Compare their address ranges. Each block covers a contiguous span, so two blocks overlap when one span starts before the other ends. Paste your list above and every pair is compared at once, with the relationship named rather than just flagged — identical, one inside the other, or merely adjacent.

Can two CIDR blocks partially overlap?

No, and this is the thing almost every overlap tool leaves out. A CIDR block is a binary prefix, and prefixes form a tree — two of them are either completely separate or one wholly contains the other. There is no third case. We tested 179,700 random pairs looking for a partial overlap and found none, because it cannot happen. If a tool reports one, either it is wrong or your input was a range rather than a block.

What is the difference between overlapping and adjacent blocks?

Overlapping blocks share addresses. Adjacent blocks share none — they simply sit next to each other, like 10.0.0.0/25 and 10.0.128.0/25. Adjacency is not a problem, it is an opportunity: two aligned adjacent blocks of the same size merge into one block of twice the size, halving your rule count without changing a single address.

Why does AWS reject overlapping VPC CIDRs?

Because routing becomes ambiguous. If two peered VPCs both contain 10.0.1.0/24, a packet for 10.0.1.5 has two equally valid destinations and no rule to choose between them. VPC peering requires non-overlapping ranges for that reason, and the same logic applies to VPNs between offices and to any two networks that need to route to each other.

Will merging my blocks change what they cover?

Not if you use the exact merge, which is the default. It produces the smallest set of blocks covering precisely the same addresses — fewer rules, identical behaviour, safe to apply. The single-supernet option is different: it gives you one block covering everything, and it will usually include addresses that were not in your list. The page counts those for you, because that number is the whole decision.

How many rules will merging save me?

The results say so directly, because that is normally the reason for doing it. Overlapping and adjacent entries collapse, duplicates disappear, and what is left is the minimum. On an AWS security group with a sixty-rule quota, going from forty entries to twelve is twenty-eight rules back. On a router, it is a shorter table and a faster lookup.

Is CIDR aggregation the same as merging?

Yes — and so are supernetting and route summarisation. All three name the same operation: collapsing several prefixes into fewer that cover the same address space. CIDR aggregation is the term the specification uses; RFC 4632 is literally titled the Internet Address Assignment and Aggregation Plan. Routing people tend to say summarisation, firewall people tend to say cleanup, and it is all the same arithmetic.

Does merging help with routing as well as firewalls?

That is what it was invented for. A router advertising forty individual /24s puts forty entries into every route table that hears it; advertised as one aggregate it is one entry. BGP, OSPF and EIGRP all support summarisation for that reason. The difference from firewall work is tolerance — a route can usually afford a supernet covering some unused space because it describes reachability, while an allow rule cannot because it describes permission.

What is a gap in a CIDR list?

An address inside the overall span of your list that none of your blocks actually covers. If your allowlist runs from 10.0.0.0 to 10.0.3.255 but has nothing for 10.0.2.0/24, that quarter is a hole. Sometimes deliberate, often not — and invisible in a list of forty entries, which is why the page reports it.

Does this work for IPv6?

Yes, using 128-bit arithmetic on the same code path. Blocks are compared within their own family, so an IPv4 block is never reported as overlapping an IPv6 one. That is not an overlap, it is two unrelated address spaces.

Can I paste a list that has comments in it?

Yes, and the comments are kept rather than discarded. Anything after #, // or ; is treated as a note, and when a block turns out to be redundant the note you wrote beside it is shown with the finding — which is usually what tells you whether it can go. Whole comment lines are skipped, blank lines ignored, and an allow or deny in front of a block is read and set aside so the same list works here and in the IP in CIDR checker.

Can I paste ranges instead of CIDR blocks?

Yes, written as start - end, and a bare address counts as a single-host block. Ranges are worth knowing about here for a specific reason: they can partially overlap where CIDR blocks cannot, so if the checker reports a partial overlap it is telling you the input was not CIDR-shaped to begin with.

How is this different from your IP in CIDR checker?

What is being compared. That page tests an address against a rule list — does it match, which rule fires first, how near was a miss. This one compares your blocks against each other and never looks at an individual address. One debugs a single request; the other tidies the whole list.

Related IP tools

The rest of the addressing toolkit.

Browse the full set on the TrustMyIP tools directory.

Last updated 25 August 2026 · Runs in your browser · Nothing you paste is sent anywhere