pjhtech Tools
Address planning

IP Range to CIDR Converter

Cover an inclusive IPv4 range with the smallest exact set of CIDR blocks.

Input

Reset restores the example inputs.

Local calculation · inputs are not sent to a server.

Result

Calculating the example…

Enter the first and last IPv4 addresses to include. Copy the returned CIDRs when you need to represent that exact range in address objects or a prefix list. No address outside the range is included.

Example: 10.42.7.9–10.42.7.22 becomes .9/32, .10/31, .12/30, .16/30, .20/31 and .22/32, all under 10.42.7.0/24.

The first address must be at or below the last. A single address becomes /32. The entire IPv4 space becomes 0.0.0.0/0. These blocks describe coverage; /31 entries do not imply that you are configuring point-to-point links.

References