IP Range to CIDR Converter
Find exact covering CIDR blocks.
IP Range to CIDR Converter: inputs and results
Enter an IP address, CIDR prefix, or range. Then check its first and last address below.
Calculated Boundaries & ParametersReady
Key Capabilities
- •100% Client-Side: Zero telemetry or server latency.
- •RFC Compliant: Exact 32-bit and 128-bit integer precision.
- •Quick Copy: Instant access to CIDR, mask, and range bounds.
- •Cross-Platform: Works on desktop, tablet, and mobile browsers.
Related Conversion & EncodingAll Tools
CIDR to IP Range Converter
Convert prefixes into start–end ranges.
IPv4 Binary Converter
Convert addresses to binary.
IPv4 Decimal Integer Converter
Convert IPv4 addresses to integer values.
Integer to IPv4 Converter
Convert integer values to addresses.
IPv4 Hexadecimal Converter
Convert addresses to hexadecimal.
How IP Range to CIDR Converter Works?
This tool works by repeatedly taking the largest aligned CIDR block that starts at the current address and stays inside the range, until the whole range is covered.
Enter a start and end
Type a range such as
192.168.1.10 – 192.168.1.100.Find the largest aligned block
At
192.168.1.10, the largest aligned block that fits is a /31 (10 is divisible by 2, not by 4).Advance and repeat
The converter moves past each block and repeats the search from the next address.
Output the exact list
The result is the shortest list of non-overlapping CIDR blocks that covers the range exactly.
IP Range to CIDR Converter Formula
The formula picks, at each step, the largest k where Start mod 2^k = 0 and Start + 2^k − 1 ≤ End, and emits Start/(32 − k).
Alignment limit
k ≤ trailing zero bits of StartA block must start on its boundary.
Size limit
k ≤ floor(log2(End − Start + 1))The block must fit the remaining range.
Next start
Start = Start + 2^kMoves past the emitted block.
Maximum block count
≤ 2 × (32 − 1) = 62Upper limit for any IPv4 range.
Worked example: 192.168.1.10 – 192.168.1.100
192.168.1.10/31 → 192.168.1.10 – 192.168.1.11 (2) 192.168.1.12/30 → 192.168.1.12 – 192.168.1.15 (4) 192.168.1.16/28 → 192.168.1.16 – 192.168.1.31 (16) 192.168.1.32/27 → 192.168.1.32 – 192.168.1.63 (32) 192.168.1.64/27 → 192.168.1.64 – 192.168.1.95 (32) 192.168.1.96/30 → 192.168.1.96 – 192.168.1.99 (4) 192.168.1.100/32 → 192.168.1.100 – 192.168.1.100 (1) Total = 91 addresses in 7 blocks
IP Range to CIDR Converter Conversion Table
The table converts 10 IP ranges into the minimal set of CIDR blocks.
| Start | End | Addresses | Blocks | CIDR List |
|---|---|---|---|---|
| 192.168.1.0 | 192.168.1.255 | 256 | 1 | 192.168.1.0/24 |
| 192.168.1.10 | 192.168.1.100 | 91 | 7 | 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/28, 192.168.1.32/27, 192.168.1.64/27, 192.168.1.96/30, 192.168.1.100/32 |
| 10.0.0.0 | 10.0.3.255 | 1,024 | 1 | 10.0.0.0/22 |
| 10.0.0.1 | 10.0.0.254 | 254 | 14 | 10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/30, 10.0.0.8/29, 10.0.0.16/28, 10.0.0.32/27, 10.0.0.64/26, 10.0.0.128/26, 10.0.0.192/27, 10.0.0.224/28, 10.0.0.240/29, 10.0.0.248/30, 10.0.0.252/31, 10.0.0.254/32 |
| 172.16.0.0 | 172.16.2.255 | 768 | 2 | 172.16.0.0/23, 172.16.2.0/24 |
| 203.0.113.64 | 203.0.113.95 | 32 | 1 | 203.0.113.64/27 |
| 198.51.100.5 | 198.51.100.12 | 8 | 4 | 198.51.100.5/32, 198.51.100.6/31, 198.51.100.8/30, 198.51.100.12/32 |
| 10.10.0.0 | 10.10.5.255 | 1,536 | 2 | 10.10.0.0/22, 10.10.4.0/23 |
| 192.0.2.200 | 192.0.3.55 | 112 | 6 | 192.0.2.200/29, 192.0.2.208/28, 192.0.2.224/27, 192.0.3.0/27, 192.0.3.32/28, 192.0.3.48/29 |
| 100.64.0.0 | 100.127.255.255 | 4,194,304 | 1 | 100.64.0.0/10 |
What is IP Range to CIDR Converter?
The IP Range to CIDR Converter is a tool that converts any start–end IPv4 range into the smallest list of CIDR blocks that covers exactly the same addresses.
Routers, cloud security groups, and most firewalls accept only CIDR prefixes. Arbitrary ranges rarely line up with 1 prefix. 10.0.0.1 – 10.0.0.254 needs 14 blocks, from a /32 up to a /26 and back down.
The output is exact: no address outside the range is added and none inside the range is missed. The Smallest Covering CIDR Calculator handles the opposite trade-off, 1 block that may include extra addresses.
What are the uses of IP Range to CIDR Converter?
There are 5 main uses of the IP Range to CIDR Converter, including cloud security groups, route filters, and registry data conversion.
Writing cloud security group rules
AWS security groups and Azure NSGs accept CIDR entries only.
Building BGP prefix filters
Prefix lists need CIDR entries for every range a peer may announce.
Converting WHOIS ranges
RIR and WHOIS records often show ranges. The converter returns the exact prefixes.
Importing DHCP ranges into firewalls
A DHCP pool such as
.100 – .199becomes a short list of firewall objects.Shrinking geolocation data
Range-based data sets convert into prefix-based data for routers and CDNs.