Skip to content

Free tools /

IP range to CIDR converter

Enter the first and last address of a range, for example 10.0.0.5 and 10.0.3.200, and get the shortest list of CIDR blocks that covers exactly those addresses and nothing else. Handy for firewall rules and allow lists. It runs in your browser; nothing is sent anywhere.

13 CIDR blocks covering 964 addresses

CIDR blocks that cover the range
CIDR blockRangeAddresses
10.0.0.5/3210.0.0.5 – 10.0.0.51
10.0.0.6/3110.0.0.6 – 10.0.0.72
10.0.0.8/2910.0.0.8 – 10.0.0.158
10.0.0.16/2810.0.0.16 – 10.0.0.3116
10.0.0.32/2710.0.0.32 – 10.0.0.6332
10.0.0.64/2610.0.0.64 – 10.0.0.12764
10.0.0.128/2510.0.0.128 – 10.0.0.255128
10.0.1.0/2410.0.1.0 – 10.0.1.255256
10.0.2.0/2410.0.2.0 – 10.0.2.255256
10.0.3.0/2510.0.3.0 – 10.0.3.127128
10.0.3.128/2610.0.3.128 – 10.0.3.19164
10.0.3.192/2910.0.3.192 – 10.0.3.1998
10.0.3.200/3210.0.3.200 – 10.0.3.2001

Questions

Why does one range turn into several blocks?

A CIDR block has to start at an address that is a multiple of its size and hold a power-of-two number of addresses. A range such as 10.0.0.5 to 10.0.3.200 does not line up like that, so it is cut into the fewest blocks that do.

Is the list the shortest possible?

Yes. It is the shortest list of blocks that includes every address in the range and no address outside it.

How do I use the result in a firewall?

Add each block as a separate rule or list entry. Most firewalls and cloud security groups accept CIDR notation directly, and a single address is written with /32.