IPv4 Range Expander
Convert an IPv4 address range (start-end) to the smallest CIDR block notation. Free online IPv4 range expander for network engineers and system administrators.
What Is an IPv4 Range Expander?
An IPv4 Range Expander (also called an IP range to CIDR converter) takes a start and end IPv4 address and computes the smallest CIDR block that contains the entire range. This is essential for network aggregation, route summarization, firewall rule consolidation, and access control list (ACL) optimization. Instead of listing every individual IP or defining multiple small subnets, you get a single compact CIDR notation that covers the specified range.
How to Use the IPv4 Range Expander
Using the tool is straightforward. Enter the start IPv4 address and the end IPv4 address of your range. The tool instantly calculates the smallest CIDR block that encompasses the entire range. It displays the CIDR notation, the new start and end addresses, the number of addresses in the original range, and the number of addresses in the resulting CIDR block. If the end address is lower than the start address, the tool shows a warning with an option to swap the values.
Why Use an IPv4 Range Expander?
Network administrators frequently need to aggregate IP ranges into single CIDR
blocks for route summarization (also known as route aggregation or supernetting).
This reduces the size of routing tables, improves network performance, and simplifies
firewall rule management. For example, instead of maintaining separate rules for
192.168.1.0 through 192.168.5.255, you can use a single
CIDR block. The IPv4 range expander finds the optimal CIDR block, minimizing
wasted addresses while ensuring the entire range is covered.
How CIDR Aggregation Works
The tool converts both IP addresses to their 32-bit binary representations and counts the number of leading bits that match between them. The matching bits become the network prefix. The remaining bits are set to all zeros for the network address and all ones for the broadcast address. The CIDR notation is formed by appending the prefix length to the network address.
Frequently Asked Questions
What is the difference between a CIDR calculator and an IPv4 range expander?
A CIDR calculator takes a CIDR notation (e.g., 192.168.1.0/24)
and expands it to show the network address, broadcast address, and usable IP
range. An IPv4 range expander does the reverse: it takes a start and end IP
address and finds the single smallest CIDR block that contains the entire
range. Use our CIDR Calculator
for the reverse operation.
Does the expanded CIDR block exactly match my IP range?
Not always. The smallest CIDR block that contains your range may include
additional addresses outside your original range. For example, the range
192.168.1.1 to 192.168.6.255 expands to
192.168.0.0/21, which covers 2048 addresses even though the
original range has only 1527 addresses. The tool shows the difference so you
can evaluate if the expanded block is acceptable.
When would I use this tool in real-world networking?
Common use cases include designing VPN tunnel policies that need to route traffic to specific IP ranges, consolidating firewall rules when merging networks after an acquisition, creating succinct BGP route advertisements for smaller IP blocks, and simplifying DHCP scope definitions for large address pools.
Can I use this tool for private and public IP addresses?
Yes. The tool works with any valid IPv4 address, including private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), public IPs, and loopback addresses. The mathematical calculation is the same regardless of the address class or purpose.
What does the difference value mean?
The difference is the number of extra addresses included in the smallest CIDR block compared to your original range. A smaller difference means the CIDR block fits your range more tightly. If the difference is large, you might want to split your range into multiple smaller CIDR blocks for a more precise fit.