IP Range to CIDR Converter
Enter the first and last IPv4 or IPv6 address. The converter finds the fewest CIDR blocks that cover every address in the range, including both ends. Your entries stay in this tab.
Jump to Merge CIDR blocksMerge CIDR blocks
Reduce a list of IP addresses and CIDR blocks to the fewest blocks that cover exactly the same addresses. The merger removes duplicates and preserves gaps. Your list stays in this tab.
For example, 192.0.2.0/26 and 192.0.2.64/26 merge into 192.0.2.0/25. Adding 192.0.2.130 also returns 192.0.2.130/32, leaving 192.0.2.128 and 192.0.2.129 outside the result.
Why a range can need multiple CIDR blocks
Each CIDR block starts at an address aligned to its size, which is a power of two. The range from 192.0.2.10 through 192.0.2.15 covers six addresses and needs two blocks.
192.0.2.10/31
192.0.2.12/30The first block covers .10 and .11. The second covers .12 through .15. For a single address, enter it in both fields to get /32 for IPv4 or /128 for IPv6.