About IP Range to CIDR Converter
Firewalls, cloud security groups and allow-lists usually want CIDR blocks, but address ranges are often handed over as a first and last address. Enter both ends and this tool lists the fewest CIDR blocks that together cover every address in the range and nothing outside it.
Each block is shown with its first and last address and its size, and the whole list can be copied one block per line. Both ends are included, so a range of a single address gives one /32.
How it works
- Starting at the first address, it takes the largest block that both begins at that address on a proper boundary and does not run past the last address.
- It moves to the address after that block and repeats until the whole range is covered.
- This greedy method always gives the minimal list; the worst case for IPv4 is 62 blocks.
Questions
Why is my range not a single block?
A CIDR block must hold a power-of-two number of addresses and start on a multiple of its size. A range that does not meet both rules needs several blocks.
Are the first and last addresses included?
Yes. The blocks cover both ends and every address between them, with nothing extra.
Can it convert IPv6 ranges?
Not yet. This tool covers IPv4 ranges only.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.