SubnetKit › IP Range to CIDR Converter
IP Range to CIDR Converter: how it works
Firewalls, cloud security groups and route tables want CIDR notation, but vendors, ISPs and spreadsheets often give you a range like 192.168.1.100 to 192.168.1.199. Unless the range happens to be a power-of-two block starting on an aligned boundary, it takes several CIDRs to express precisely.
SubnetKit's CIDR tab computes the minimal list in the browser, for free, and also does the reverse: expand any CIDR into its first and last address.
Worked example: 192.168.1.100 – 192.168.1.199
100 addresses, not aligned to any single block, so the converter produces five CIDRs:
- 192.168.1.100/30 → .100–.103 (4 addresses)
- 192.168.1.104/29 → .104–.111 (8)
- 192.168.1.112/28 → .112–.127 (16)
- 192.168.1.128/26 → .128–.191 (64)
- 192.168.1.192/29 → .192–.199 (8)
4 + 8 + 16 + 64 + 8 = 100, with no address outside the request. The algorithm walks from the start address, each time choosing the largest block that both starts on an aligned boundary (a /29 must begin on a multiple of 8, a /26 on a multiple of 64) and does not overshoot the end address.
Ranges that collapse to a single CIDR
Some ranges are already clean blocks, and the tool reports just one line:
- 192.168.1.0 – 192.168.1.255 → 192.168.1.0/24
- 10.0.0.0 – 10.0.1.255 → 10.0.0.0/23 (512 addresses)
- 172.16.0.0 – 172.31.255.255 → 172.16.0.0/12
A common mistake is to exclude the network and broadcast when writing the range. 10.0.0.1 – 10.0.0.254 is not a /24; it needs 14 CIDRs (10.0.0.1/32, 10.0.0.2/31, 10.0.0.4/30 … 10.0.0.254/32). If you mean the whole subnet, enter .0 to .255. SubnetKit also includes a membership check so you can confirm a single address, such as 192.168.1.150, falls inside the CIDR you are about to put in a rule.
Frequently asked questions
Why does my range turn into several CIDR blocks?
CIDR blocks must be a power of two in size and start on a boundary divisible by that size. A range that is not aligned has to be covered by multiple smaller blocks.
How do I convert a CIDR back to a range?
Enter the CIDR in the CIDR-to-range field; SubnetKit shows the first and last address, total count and mask.
Can I check whether an IP is inside a CIDR?
Yes. The CIDR tab includes a check that tells you whether an address belongs to a given block, for example whether 192.168.1.150 is in 192.168.1.128/26.
Is there a limit on range size?
No. Any IPv4 range from a single address up to 0.0.0.0–255.255.255.255 is supported, and results are computed instantly in the browser.
Looking for the full guide, tips and the complete FAQ? Read the main SubnetKit page.