IP Range to CIDR Converter
Convert an IPv4 start-end range into the smallest set of CIDR blocks that covers it, and expand any CIDR back to its first and last address and count.
192.168.1.0/25 192.168.1.128/31 192.168.1.130/32
192.168.1.0/24256 addresses — 125 more than asked for10.0.0.010.0.0.34🔒 Runs in your browser — nothing is uploaded.
What this IP range to CIDR converter does
Enter an IPv4 range as a start and end address — for example 192.168.1.0 to 192.168.1.130 — and this tool returns the smallest set of CIDR blocks that exactly covers it, with no address left out and none added. That range becomes 192.168.1.0/25, 192.168.1.128/31 and 192.168.1.130/32. It also works the other way: type a CIDR block like 10.0.0.0/30 and it expands to the first address, last address and total number of addresses in the block. Firewalls, router ACLs, security-group rules and allow-lists usually expect CIDR notation rather than a raw start–end range, so this saves you the error-prone bit math.
How the conversion works
The range is packed into CIDR blocks with a greedy largest-block algorithm. At each step it takes the biggest power-of-two block that is both aligned to the current start address and small enough to fit inside what remains of the range, records it, and moves the start past it. Because every block must be aligned, an arbitrary range can need several blocks of different sizes, but never more than about sixty. Expanding a CIDR does the reverse: it masks off the host bits below the prefix to find the network (first) address, adds the block size to reach the broadcast (last) address, and reports the count as two raised to the number of host bits. Everything runs as plain 32-bit integer math in your browser.
Frequently asked questions
What is the smallest CIDR set for an IP range?
It is the fewest CIDR blocks whose addresses add up to exactly the range, with none left out and none added. Because CIDR blocks are power-of-two sized and aligned, a range like 192.168.1.0–192.168.1.130 cannot be a single block; the minimal set is 192.168.1.0/25, 192.168.1.128/31 and 192.168.1.130/32.
Why does my range turn into several blocks of different sizes?
A CIDR block always covers a power-of-two number of addresses starting on an aligned boundary. When your start address or length does not line up with one power of two, the range is filled with progressively smaller aligned blocks. That is expected and is still the minimal covering set.
Does it handle /31 and /0?
Yes. A two-address point-to-point range collapses to a /31, and the entire IPv4 space from 0.0.0.0 to 255.255.255.255 collapses to a single 0.0.0.0/0. Expanding /0 reports 4,294,967,296 total addresses with no overflow.
Is my data uploaded anywhere?
No. All parsing and the range-to-CIDR math run locally in your browser with JavaScript. The addresses you type are never sent, stored or uploaded to any server.