Turn a start and end IP into the smallest set of CIDR blocks, or expand a CIDR back to its first and last address — all in your browser.
IP Range to CIDR Converter
Turn a start and end IP into the smallest set of CIDR blocks, or expand a CIDR back to its first and last address — all in your browser.
The IP Range to CIDR Converter runs entirely in your browser. The start and end addresses, CIDR blocks, and ranges you enter are processed on your device and never uploaded to ArrayKit.
The IP Range to CIDR Converter takes a start and end address and returns the minimal set of aligned CIDR blocks that cover the range exactly — no more, no less. It uses a greedy largest-block algorithm, so a tidy range like 192.168.1.0 to 192.168.1.255 collapses to a single 192.168.1.0/24, while an off-boundary range splits into the fewest blocks that still add up to the exact address count. Flip to reverse mode to expand any CIDR back into its network, first IP, last IP, and total address count. Both IPv4 and IPv6 are supported, with big-integer math so even a /32 IPv6 prefix reports its full 2^96 count. It is built for network engineers writing firewall rules, ACLs, route tables, and allowlists, and everything runs on your device so your topology never leaves the browser.
Features
Aggregate any start–end IP pair into the minimal set of aligned CIDR blocks
Greedy largest-block algorithm — fewest blocks that cover the range exactly
Reverse mode expands a CIDR to network, first IP, last IP, and address count
Full IPv4 and IPv6 support with big-integer math for huge prefixes
Copy every emitted CIDR block at once for pasting into ACLs or route tables
Reports the exact address count so you can verify coverage at a glance
Clear errors for reversed ranges, mixed IP versions, and malformed input
Runs entirely in your browser — no addresses or ranges are uploaded
How to use the IP Range to CIDR
Keep the Range → CIDR tab selected
Enter the start and end IP address (both IPv4 or both IPv6)
Read the aggregated CIDR blocks and copy them with one click
Switch to CIDR → Range to expand a block into its first and last IP
An off-boundary range splits into the fewest blocks that cover it exactly.
Common errors & troubleshooting
The tool reports 'Start address must be less than or equal to the end address.' — The start IP is numerically higher than the end IP. Swap the two values so the smaller address is in the Start field.
'Start and end must be the same IP version' appears. — You mixed an IPv4 address with an IPv6 one. Use two IPv4 addresses or two IPv6 addresses — a single range cannot span both families.
A neat-looking range produces more blocks than expected. — CIDR blocks must be power-of-two sized and aligned to their own boundary. A range that does not start and end on those boundaries needs several blocks; the counts still sum to the exact range size.
Reverse mode shows a different network than the address you typed. — A CIDR is defined by its network address, so host bits are masked off. 192.168.1.130/24 normalizes to 192.168.1.0/24 — that is expected.
Frequently asked questions
How does the converter pick which CIDR blocks to output?
It walks the range from the start address and, at each step, emits the largest block that is both aligned to the current address and fits inside the remaining range. Repeating that greedily yields the minimal set of CIDR blocks that cover the range exactly.
Why does my range turn into several CIDR blocks instead of one?
A single CIDR block always contains a power-of-two number of addresses aligned to its own boundary. Unless your start and end line up on those boundaries, no one block can cover the range, so it is split into the fewest blocks whose sizes add up to the exact count.
Does it handle IPv6 ranges and huge prefixes?
Yes. IPv6 addresses are parsed into 128-bit big integers, so the same aggregation works for v6 and the reverse mode can report enormous counts — a /32 IPv6 block, for example, contains 2^96 addresses.
What does CIDR → Range mode return?
Paste a block like 10.0.0.0/24 or 2001:db8::/32 and it shows the network address, the first IP, the last IP, and the total number of addresses in the block, masking any host bits to the network boundary first.
Can I paste an IP that is not the network address of the block?
Yes. In CIDR → Range mode the host bits are masked off automatically, so 192.168.1.200/24 and 192.168.1.0/24 both resolve to the same network, first IP, and last IP.
Are my IP addresses sent to a server?
No. The IP Range to CIDR Converter runs entirely in your browser. The addresses and ranges you enter are computed on your device and are never uploaded to ArrayKit.