IP & Networks

CIDR merger

One CIDR or IP per line. Choose a set operation; splitting uses only list A.

CIDR merger

List A

List B

Result CIDRs

Calculated in this browser. No network queries or input storage.

Calculation options

Exact union of both lists; gaps stay excluded.

Combined input: 1000 nonempty lines / 100000 UTF-16 units. Output: up to 4096 CIDRs. Counts include all addresses.

Inputs or options changed. Calculate again before exporting.

A CIDR merger is useful when a long allowlist hides duplicate or overlapping entries. Compare the addresses covered by two lists instead of comparing their text. A different prefix can describe the same coverage, while one missing subnet can change the result substantially.

Why use this CIDR merger

Fewer prefixes, the same coverage

The CIDR merger combines aligned adjacent blocks and removes redundant coverage. Two /25 siblings become a /24; two separated /26 blocks remain separate. The gap is preserved, so a shorter output never quietly admits addresses you did not supply.

Adjacent colored address blocks combine into a longer block while an unfilled gap remains visible.

Exclude addresses, not whole lines

An exclusion can cut through the middle of a network. Subtracting 192.0.2.64/26 from 192.0.2.0/24 leaves 192.0.2.0/26 and 192.0.2.128/25. The result expresses both remaining portions with aligned prefixes, even though neither line appeared in the input.

A red middle block is removed from a long address band, leaving separate aligned blocks on either side.

Choose direction and block size

01

Check the direction

A − B keeps addresses in A that B does not cover. B − A reverses that decision without replacing your input. Overlap shows the common address space, including partial intersections rather than just matching text.

02

A larger prefix makes smaller blocks

The CIDR splitter uses only A and retains B for later operations. /26 divides a /24 into four pieces. Every original A prefix must be no longer than its family’s target prefix; even a contained /32 can therefore block a /26 split.

03

Freeze the current result

Automatic calculation waits 350 ms after editing. Turn it off to use Calculate or Ctrl/Cmd + Enter. Any edit disables export until recalculation. Examples and Clear preview replacement counts; Undo restores the previous inputs and result.

Address coverage, measured precisely

Exact CIDR aggregation

Duplicate and contained ranges count once. Networks are sorted numerically, IPv4 first. Host bits are normalized to the network boundary and counted in the report, without rewriting either source list.

CIDR overlap checker

Intersection and overlap return the shared ranges of A and B. A list may be empty: its intersection is empty, while subtracting it changes nothing. An empty successful result is distinct from an input error.

CIDR exclusion calculator

Both difference directions can remove several overlapping exclusions at once. Exclusions outside the source do nothing. A containing exclusion removes the whole source; smaller exclusions create only the necessary remaining CIDRs.

Full-size integer counts

IPv6 uses exact 128-bit arithmetic. ::/0 contains 340282366920938463463374607431768211456 addresses. Results show each family separately; Copy and TXT download include all computed prefixes, even when only the first 100 are displayed.

Input contract and limits

Strict line format
Use one CIDR or bare IP per line; bare addresses mean /32 or /128. Blank lines are ignored. Ranges, wildcard octets, dotted masks, comments, URLs, zone IDs and leading-zero IPv4 octets are rejected. One bad line stops the whole calculation and identifies its list and line.
Bounded complete output
Both inputs together may contain 1000 nonempty lines and 100000 UTF-16 code units. Output is limited to 4096 CIDRs. Splits are counted before generation; excessive results fail rather than exporting an incomplete prefix list. Use a shorter target prefix or a smaller source.
Separate address families
IPv4 and IPv6 do not intersect. IPv4-mapped IPv6 remains IPv6 and is written in hexadecimal form. There is no automatic mapping between families or conversion of address ranges.
Total addresses, not usable hosts
Counts include every address in each covered range. They do not deduct network, broadcast or cloud reservations. No host enumeration, VLSM allocation or host-demand planning is performed.
Coverage is not routing policy
The tool never fills gaps to force one covering supernet. Equal coverage does not establish equal BGP next hops, ACL ordering or cloud compatibility. There is no file or URL import, network lookup or persistent storage of your lists.

CIDR merger questions

When can adjacent CIDR networks be merged?

Aligned sibling networks of the same prefix length can become their parent. For example, 192.0.2.0/25 and 192.0.2.128/25 form 192.0.2.0/24. Adjacency alone is insufficient when the parent boundary does not align.

Does aggregation remove duplicate and contained networks?

Yes. Set union counts an address once, whether it appears in duplicate networks or in a smaller network already contained by a larger one. This changes the representation, not the addresses covered.

Can separate CIDR blocks be combined without including the gap?

Yes, as a list of exact CIDRs. The result keeps separate blocks where there is a gap. It will not broaden the list to a single supernet that also covers unspecified addresses.

How do I subtract several subnets from a larger CIDR?

Put the larger networks in A, exclusions in B, and choose A − B. Exclusions are combined before subtraction. The remainder may contain several prefixes rather than the original network line.

Which target prefix lengths can a CIDR be split into?

Choose a target at least as long as every original prefix of that family: up to /32 for IPv4 or /128 for IPv6. Equal length preserves a block. A split requiring more than 4096 results is rejected.

Is exact CIDR aggregation sufficient to preserve routing policy?

No. Address coverage alone cannot represent next hops, route preference or ordered firewall decisions. Review those settings in the target system before replacing its configuration.

Have another domain case to check?

Review the resulting address space

Use the CIDR merger with your two lists, verify the operation direction, then copy the complete result.