Cover an IP range with a minimal CIDR block
All computation runs locally in your browser

| old value | new value | |
|---|---|---|
| Start address | 192.168.1.1 | 192.168.0.0 |
| End address | 192.168.6.255 | 192.168.7.255 |
| Addresses in range | 1,535 | 2,048 |
| CIDR | 192.168.0.0/21 |
The IPv4 Range Expander takes a start IPv4 address and an end IPv4 address, then expands them to the smallest single CIDR block that covers the entire interval. You’ll see how the “old” range compares to the “new” CIDR-aligned range.
Who is this for?
Practical takeaway: the expanded CIDR range often includes extra addresses. This tool makes that “extra” explicit so you can decide if a single CIDR is acceptable.
If you need subnet details (netmask, broadcast, usable range), pair this with our IPv4 subnet calculator.
Worked example
Suppose you have:
A single covering CIDR in this case becomes:
The tool also compares how many addresses are in the original interval versus the expanded CIDR-aligned block. In general, range size is:
Firewall allowlist
Input a vendor’s IP range, then see whether a single CIDR block is too permissive.
Example: to .
Data center migration
When consolidating address allocations, check if multiple small ranges can be represented as a single CIDR.
Then validate subnet details with the IPv4 subnet calculator.
Audit “extra” IPs
Expanded CIDRs include extra addresses. Compare sizes and decide if the blast radius is acceptable.
If the new size is much larger than the old size, consider using multiple CIDRs instead.
Scripting & config templates
Copy the CIDR into infrastructure-as-code or reverse proxy configuration.
Result shown as (CIDR length $\ell$).
Turn an IP interval into CIDR
Useful when a system only accepts CIDR notation, not start/end ranges.
Review firewall rule scope
Compare old size vs new size to see how permissive the CIDR becomes.
Document network allocations
Create a clean CIDR for docs and then validate details with the subnet calculator.
Check config drift
If a config says /16 but you expected a smaller interval, verify quickly.
Security incident triage
Estimate how many IPs a single CIDR could cover during containment.
Vendor IP list cleanup
When a vendor gives multiple IPs, see if a single CIDR is acceptable or too broad.
When this may not fit: if you need a tight representation, you often need multiple CIDR blocks. This tool intentionally outputs the smallest single covering block.
The core idea is: write both IPs as 32-bit binary strings, find the first bit where they differ, and then build a CIDR prefix that keeps the common leading bits.
Steps
Range size uses:
Note: this produces the smallest single CIDR that covers the whole interval. It does not attempt to split the interval into multiple smaller CIDRs.
CIDR notation
CIDR represents a contiguous block of IP addresses as , where $\ell$ is the prefix length (how many leading bits are fixed).
Why ranges expand
A CIDR block must align to powers of two. Arbitrary start/end boundaries typically don’t align, so the smallest single covering CIDR may include extra addresses on both sides.
Because CIDR blocks must have sizes of $2^n$ and must start on specific boundaries. If your start/end don’t align, the smallest single covering CIDR needs to expand to the nearest valid boundaries.
No — it returns the smallest single CIDR that covers the full interval.
Then the interval is invalid, and no covering block can be calculated. Swap the values or correct the inputs.
It’s the smallest single CIDR. If you want the tightest representation, multiple CIDRs are often better.
Yes — paste the CIDR into the IPv4 subnet calculator.
This calculator is for educational and operational convenience. Always review firewall and routing changes carefully, especially when the expanded block includes extra addresses.
Use a simple chronometer (stopwatch) to track elapsed time down to milliseconds. Runs locally in your browser.
Normalize email addresses to a standard format for easier comparison. Useful for deduplication and data cleaning. Runs locally in your browser.
Estimate the time needed to consume a total amount at a constant rate, and get an expected end time. Runs locally in your browser.
Parse and decode your JSON Web Token (JWT) and display its content. All computation runs locally in your browser.
Know which file extensions are associated to a MIME type, and which MIME type is associated to a file extension. Includes a full MIME types table.
Generate random Lorem Ipsum placeholder text with customizable paragraphs, sentences, and word counts. Runs locally in your browser.