About ip range calculator
Turn a start and an end IP address into the smallest list of CIDR blocks that cover exactly that range.
Why several blocks
A range that does not line up with a power of two cannot be written as one CIDR block, so it is split into the fewest blocks that fit.
Use it for
- Firewall and allow-list rules.
- Cloud security groups.
- Cleaning up IP lists.
Runs in your browser
Calculations on this page happen on your device. Nothing you enter is uploaded.
A worked example
The range 192.168.1.10 to 192.168.1.20 cannot be a single block, so it is expressed as 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32. The list can go straight into a firewall rule or an allow list.
Tips
- Prefer ranges that line up with powers of two, which give fewer blocks.
- Check the result by listing the first and last address of each block.
- Keep allow lists as short as you can.
