IPv6 Range ↔ CIDR

CIDR → Range

Start: 2001:db8::

End: 2001:db8::ffff:ffff:ffff:ffff

Range → Minimal CIDRs

CIDRs:

  • 2001:db8::/64

About This Tool

The IPv6 Range to CIDR converter is a bidirectional tool that seamlessly converts between IPv6 address ranges and CIDR notation. It can convert an IPv6 CIDR block (like 2001:db8::/64) into its start and end addresses, or take an arbitrary IPv6 range and calculate the minimal set of CIDR blocks needed to represent it exactly. Given the complexity of IPv6's 128-bit address space, this tool is essential for network documentation, firewall configuration, and working with systems that require different IPv6 address representation formats.

How to Use

  1. For CIDR to Range: Enter an IPv6 CIDR block (e.g., 2001:db8::/64) in the left panel to see the first and last IPv6 addresses
  2. For Range to CIDR: Enter a start IPv6 address and end IPv6 address in the right panel
  3. The tool automatically calculates the minimal set of CIDR blocks that exactly cover the IPv6 range
  4. Both compressed and expanded IPv6 address formats are accepted
  5. Results update in real-time as you type
  6. Copy the CIDR list for use in firewall rules, routing tables, or network documentation

Features

  • Bidirectional conversion: IPv6 CIDR to range AND range to CIDR
  • Calculates minimal CIDR representation for any IPv6 address range
  • Real-time conversion as you type
  • Handles arbitrary (non-aligned) IPv6 ranges
  • Accepts both compressed (::) and expanded IPv6 formats
  • Produces optimized CIDR blocks for efficient routing
  • Validates all IPv6 addresses and CIDR notation
  • Side-by-side interface for easy bidirectional comparison

Common Use Cases

  • Converting IPv6 ranges from cloud provider consoles to CIDR notation
  • Translating IPv6 firewall rules from range format to CIDR blocks
  • Determining CIDR blocks needed to represent specific IPv6 address ranges
  • Converting IPv6 DHCP (DHCPv6) ranges to CIDR for documentation
  • Planning IPv6 address allocations in AWS VPCs, Azure VNets, or GCP networks
  • Optimizing IPv6 security group rules with minimal CIDR blocks
  • Converting between formats required by different networking equipment
  • Verifying IPv6 range coverage for network planning and allocation
  • Creating accurate documentation for IPv6 address assignments
  • Translating legacy IPv6 range specifications to modern CIDR notation

Technical Details

Converting between IPv6 ranges and CIDR notation involves complex binary alignment calculations due to the 128-bit address space. The tool uses efficient algorithms to ensure minimal CIDR representation.

CIDR to Range (Straightforward):

  • 2001:db8::/64 → Start: 2001:db8::, End: 2001:db8::ffff:ffff:ffff:ffff (2^64 addresses)
  • 2001:db8::/48 → Start: 2001:db8::, End: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff (2^80 addresses)
  • 2001:db8::/32 → Start: 2001:db8::, End: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff (2^96 addresses)

Range to CIDR (Complex):

When an IPv6 range doesn't align with CIDR boundaries, multiple blocks may be required. For example, 2001:db8::5 to 2001:db8::14 requires multiple CIDRs because the range doesn't align on bit boundaries:

  • 2001:db8::5/128 (single address)
  • 2001:db8::6/127 (2 addresses: ::6-::7)
  • 2001:db8::8/125 (8 addresses: ::8-::f)
  • 2001:db8::10/126 (4 addresses: ::10-::13)
  • 2001:db8::14/128 (single address)

Algorithm Optimization:

The tool uses a greedy algorithm that finds the largest power-of-2-aligned CIDR block that fits within the remaining range, then recursively processes the rest. This produces the minimal number of CIDR blocks, which is optimal for:

  • Routing table efficiency (fewer entries)
  • Firewall rule performance (faster matching)
  • Configuration file size (minimal complexity)
  • Human readability and maintainability

IPv6-Specific Considerations:

Unlike IPv4, IPv6's vast address space means range-to-CIDR conversions can produce many more CIDR blocks for non-aligned ranges. The tool handles compressed notation (::) and expands addresses internally for accurate calculations, then returns results in standard compressed format for optimal readability.