Skip to main content
IPv6 tools100% FreeInstant

IPv6 Range to CIDR: Convert an Address Range to CIDR

This free IPv6 range to CIDR converter takes a start and end address and returns the smallest list of CIDR blocks that covers the range exactly. It is useful for firewall rules and routing tables.

By Debmedia Technologies LLP · Kolkata, India · Updated

What Is IPv6 Range to CIDR Conversion?

IPv6 range to CIDR conversion finds the shortest list of CIDR prefixes that exactly covers a range between two IPv6 addresses. Registries, hosting panels and some databases give you a start and an end address, but routers and firewalls want prefixes. This tool does the translation.

A range that lines up with a prefix boundary needs only one block. Most real ranges do not, so the answer is usually a short list of blocks of different sizes.

How to Use This IPv6 Range to CIDR Converter

  1. Enter the first address of the range, for example 2001:db8::.
  2. Enter the last address, for example 2001:db8::ffff.
  3. Press Convert.
  4. Copy the CIDR blocks from the table into your firewall or routing configuration.

A Worked Example

The range 2001:db8::1 to 2001:db8::6 cannot be a single block, because it does not start on a boundary. It needs these blocks:

BlockCovers
2001:db8::1/1282001:db8::1 only
2001:db8::2/1272001:db8::2 to 2001:db8::3
2001:db8::4/1272001:db8::4 to 2001:db8::5
2001:db8::6/1282001:db8::6 only

The rules of aggregation come from CIDR, described in RFC 4632, which describes CIDR aggregation.

How the Tool Finds the Smallest List

  • It starts at the first address and finds the largest block that begins exactly there.
  • It shrinks the block until it fits inside the remaining range.
  • It adds the block to the list, moves to the next address and repeats.
  • It stops when the end address is covered, or after 200 blocks.

Choosing the largest fitting block each time always gives the fewest prefixes, so you never get a longer list than necessary.

Tips

Everything runs in your browser. Nothing you enter is sent to our server.

Where This Conversion Is Needed

Registries and hosting panels often publish ranges, while routers, cloud security groups and firewalls want prefixes. Converting by hand means binary maths on 128-bit values, which is slow and easy to get wrong. This tool does it in a blink and keeps the list as short as possible, so your rule sets stay small and easy to audit.

It is also useful when you merge ranges from several sources. Convert each one, then check the blocks with the prefix calculator to see exactly which addresses they cover.

Very large ranges are no problem, because the tool uses exact big-integer maths and never rounds.

Frequently Asked Questions

A CIDR block must start on a boundary that fits its size. A range that does not line up with those boundaries has to be split into several blocks.
Yes. The tool always picks the largest block that fits at each step, which gives the fewest prefixes.
The list is capped at 200 blocks. Very irregular ranges can need more than that.
No. The calculation runs in your browser.

Disclaimer: results come from live requests and can change as records and servers change. We cannot guarantee that every answer matches what every visitor sees.