Network, broadcast, host range and masks for any IPv4 CIDR
IP Range to CIDR
Turn any address range into firewall-ready CIDR blocks with no gaps and no extras.
Loading tool…
How to use ip range to cidr
Enter the first and last address of the range.
Copy the list of CIDR blocks.
Use the second panel to turn a CIDR block back into its first and last address.
What this tool does
- Produces the minimum number of blocks that cover the range exactly.
- Works for IPv4 and IPv6 with exact integer maths.
- Checks that the blocks have no gaps or overlaps and add up to the range size.
- Swaps the ends into order if you type them backwards.
How the result is verified
The tool re-adds the block sizes and checks each block starts where the last ended; results matched Python's summarize_address_range on random ranges during development.
Frequently asked questions
Why do I get several blocks instead of one?
A CIDR block must start on a boundary that matches its size. A range like .10 to .200 does not, so it takes several aligned blocks to cover it exactly.
Can I use the output in a firewall or allowlist?
Yes. Each line is a standard CIDR block accepted by iptables, nftables, cloud security groups and most allowlists.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Divide an IPv4 or IPv6 network into equal smaller subnets
IPv4 as integer, hex, binary and IPv4-mapped IPv6, in both directions
Compress, expand and analyse IPv6 addresses and prefixes