CIDR Block Merger

Paste addresses and CIDR blocks, one per line, and the page merges the ones that are adjacent or overlapping into the smallest set of blocks. It also turns an IP range, from its first address to its last, into the blocks that cover it.

Free Runs in your browser Checked Tuesday, November 10, 2026

What to do

Merge a list of addresses and blocks, or turn an IP range into blocks.

One per line: an address such as 192.0.2.1, or a block such as 192.0.2.0/24 or 2001:db8::/32. IPv4 and IPv6 can be mixed.

Result

Blocks in the result — The number of CIDR blocks that cover the input.
Entries read — Addresses and blocks read from the list.
Addresses covered — The total for each family.
Blocks, one per line
Blocks

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Choose Merge a list under What to do, then paste your addresses and blocks into Addresses and blocks, one per line.
  2. Read Blocks in the result for the number of blocks, and Addresses covered for the total in each family.
  3. Copy the blocks from Blocks, one per line. To turn a range into blocks, choose Range to blocks and fill in First address and Last address.

How blocks are merged

A CIDR block is a power-of-two number of addresses that starts on a multiple of its own size, written as an address and a prefix length (RFC 4632, section 3.1). Two blocks that are side by side, or that overlap, cover one range of addresses, and the page joins them into the smallest blocks that cover exactly that range. A block that lies inside another one is dropped.

  • Two halves of a block join into the block: 192.0.2.0/25 and 192.0.2.128/25 become 192.0.2.0/24.
  • Addresses that are side by side but not aligned stay apart: 192.0.2.1 and 192.0.2.2 are two /32 blocks, because a /31 must start on an even address.
  • IPv4 and IPv6 are merged separately, since each block belongs to one family.

Turning a range into blocks

A range from a first address to a last one is covered by blocks taken greedily: each block starts at the next address of the range, is as large as its start allows, and does not pass the last address. A range of 192.0.2.1 to 192.0.2.10 needs five blocks: a /32, a /31, a /30, a /31 and a /32. No block covers an address outside the range.

Example: the range 192.0.2.1 to 192.0.2.10

The first address, 192.0.2.1, is odd, so it can only be a block of one address. The next addresses, 192.0.2.2 and 192.0.2.3, form a /31. Then 192.0.2.4 to 192.0.2.7 form a /30, 192.0.2.8 and 192.0.2.9 a /31, and the last address, 192.0.2.10, a block of one.

Together these five blocks cover the ten addresses of the range, and no others.

Measure Value
Blocks 5
Addresses covered 10
First block 192.0.2.1/32

Frequently asked questions

What is the difference between a block and a range?

A block is a CIDR prefix: a power-of-two number of addresses that starts on a multiple of its size, such as 192.0.2.0/24 for 256 addresses (RFC 4632, section 3.1). A range is any run of addresses from a first one to a last one, which need not form a block, so it may need several blocks to cover it.

Can the result cover addresses that are not in my list?

No. Merging joins only the entries you gave, and it drops those that lie inside another, so the blocks cover exactly the addresses of your entries and nothing else.

Can I mix IPv4 and IPv6 in the same list?

Yes. The page reads both, and merges each family on its own. The addresses of each family are totalled separately, because an IPv4 address and an IPv6 address are not counted together.

What happens if a line has host bits set, such as 192.0.2.5/24?

The page reads the line as the block that holds it, 192.0.2.0/24, and says so in a note. A prefix describes a block, so the bits after the prefix length are not part of the block.

Does this tool send my list anywhere?

No. The merge runs in your browser, and nothing you paste is sent or stored.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.