Skip to content
ENExplore Calculators

CIDR Merge Calculator

Merge consecutive CIDR blocks into a single aggregate and check that the starting network is correctly aligned.

About CIDR Merge Calculator

Merging 2^k adjacent blocks shortens the prefix by k bits. The merge is only lossless if the first network address sits on a boundary of the larger block, otherwise the aggregate covers space that belongs to a neighbour. Aggregation is what keeps routing tables and security-group rule counts small, but a misaligned summary advertises address space you do not own.

Formula

CIDR Merge

merged prefix = p − ceil(log2(blocks)); the aggregate is valid only when the first network is a multiple of the aggregate block size.

p
Prefix length of each component block
blocks
Number of consecutive blocks being merged

Worked example

With the default values below, CIDR Merge Calculator returns Merged CIDR of 192.168.8.0/22. Change any input above and every figure here is recalculated in your browser.

Inputs used

First network address
192.168.8.0
Prefix length of each blockaccepts 1–32 bits
24 bits
Number of consecutive blocksaccepts 1–4,096 blocks
4 blocks

Results

Merged CIDR
192.168.8.0/22
Merged Prefix Length
22
Correctly Aligned
Yes
Blocks Absorbed but Unused
0

Step by step

  1. 1Values used
  2. 2CIDR Merge
  3. 3Merged CIDR= 192.168.8.0/22
  4. 4Merged Prefix Length= 22
  5. 5Correctly Aligned= Yes
  6. 6Blocks Absorbed but Unused= 0

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is CIDR Merge calculated?

merged prefix = p − ceil(log2(blocks)); the aggregate is valid only when the first network is a multiple of the aggregate block size. Merging 2^k adjacent blocks shortens the prefix by k bits. The merge is only lossless if the first network address sits on a boundary of the larger block, otherwise the aggregate covers space that belongs to a neighbour.

Why does CIDR Merge matter?

Aggregation is what keeps routing tables and security-group rule counts small, but a misaligned summary advertises address space you do not own.

What values do I need to enter?

This calculator takes 3 inputs: First network address, Prefix length of each block, Number of consecutive blocks. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

CIDR Merge Calculator | Calcrivo