Skip to content
Calcrivo

CIDR Merge Calculator

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

Inputs

bits
blocks

Merged CIDR

192.168.8.0/22

Merged Prefix Length

22

Correctly Aligned

Yes

Blocks Absorbed but Unused

0

Step by step

  1. Values used

    First network address = 192.168.8.0; Prefix length of each block = 24 bits; Number of consecutive blocks = 4 blocks

  2. 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.

  3. Merged CIDR

    = 192.168.8.0/22

  4. Merged Prefix Length

    = 22

  5. Correctly Aligned

    = Yes

  6. Blocks Absorbed but Unused

    = 0

How it works

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

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.

You might also need