IP Range / CIDR Converter
Convert a start/end IP pair to CIDR notation, or expand a CIDR to its IP range.
About IP Range
Takes a start and end IP address and converts that range into the smallest set of CIDR blocks that exactly cover it. This comes up whenever you have an IP range from a source that doesn't speak CIDR — a firewall vendor's allow-list, a cloud provider's published range — and need to translate it into notation your router or firewall actually accepts. Ranges that don't align to a clean power-of-two boundary get broken into multiple CIDR blocks automatically rather than requiring manual binary math.
A range that doesn't start on a clean power-of-two boundary can expand into a surprising number of small CIDR blocks rather than one tidy one — if a firewall has a hard limit on allow-list entries, it's worth re-requesting the range from its source with cleaner boundaries.
Related Tools
How range-to-CIDR conversion works
A CIDR block always covers a power-of-two number of addresses and must start on a matching boundary. An arbitrary range usually doesn't, so the converter covers it with the smallest set of aligned blocks: starting at the first address, it takes the largest block that is aligned there and does not pass the end address, then repeats from the next address.
Example: 10.0.0.5 – 10.0.0.20 becomes five blocks:
| Block | Covers |
|---|---|
10.0.0.5/32 | .5 |
10.0.0.6/31 | .6 – .7 |
10.0.0.8/29 | .8 – .15 |
10.0.0.16/30 | .16 – .19 |
10.0.0.20/32 | .20 |
A range such as 10.0.0.0 – 10.0.0.255 collapses into a single 10.0.0.0/24.
Where you need it
- Firewall and allow-lists — iptables/ipset, nginx
allow/deny, cloud security groups and WAF rules accept CIDR, not ranges. - Vendor IP lists — payment gateways, monitoring services and partners often publish start/end ranges.
- Registry and geo data — RIR allocation files and some GeoIP exports list ranges that need converting.
To inspect one of the resulting blocks — mask, broadcast, usable hosts — open it in the CIDR / subnet calculator. To see who announces a range, look up its ASN.