IP Range to CIDR

Convert any IP address range to the minimal set of CIDR blocks.

Convert IP Range to CIDR

Enter a start and end IP address to calculate the minimal set of CIDR blocks that exactly cover the range. An arbitrary range often cannot be expressed as a single CIDR block, so this tool splits it into the fewest blocks needed.

Start IP
End IP
CIDR Blocks

Why does a range need multiple CIDR blocks?

A CIDR block must start at an address that is a multiple of its size, and its size must be a power of two. An arbitrary range like 192.168.1.0 - 192.168.3.255 does not align to a single power-of-two boundary, so it must be split into multiple blocks - in this case, 192.168.1.0/24 and 192.168.2.0/23.

This conversion is commonly needed when configuring firewalls, cloud security groups, or routing tables that only accept CIDR notation. Rather than manually calculating the blocks, this tool finds the minimum number of CIDR entries to exactly represent any IP range.

Need IP data in your application?

IP Trust provides detailed IP intelligence including IP geolocation, IP to ASN, VPN detection and more. Access via IP API or IP database downloads. Free trial, with no credit card required.