IP MANAGE

Free IP range to CIDR converter

IP Range to CIDR Converter

Enter the first and last address of a range to get the fewest CIDR blocks that cover it exactly. A range only becomes one block when it starts on a boundary and its size is a power of two: 192.168.1.0 to 192.168.1.255 is 192.168.1.0/24, while 10.0.0.5 to 10.0.0.20 needs five.

Convert a range

10.0.0.5 – 10.0.0.20 as 5 CIDR blocks

This is an example result. Enter your own range above and press Convert.

CIDR blocks
5
Addresses covered
16
CIDRFirst addressLast addressAddressesCopy
10.0.0.5/3210.0.0.510.0.0.51
10.0.0.6/3110.0.0.610.0.0.72
10.0.0.8/2910.0.0.810.0.0.158
10.0.0.16/3010.0.0.1610.0.0.194
10.0.0.20/3210.0.0.2010.0.0.201

How a range becomes CIDR blocks

Start at the first address. Take the biggest block that begins there (the more zero bits at the end of the address, the bigger it can be) without going past the last address. Move to the first address after that block and repeat until the range is covered.

For 10.0.0.5 to 10.0.0.20: the address ends in …101 in binary, so only a single address fits (/32). Then .6 can start a /31, .8 a /29, .16 a /30 and .20 a /32. Greedy from the left always gives the fewest blocks.

Going the other way? The CIDR calculator shows the first and last address of any block, and the overlap checker tells you whether the blocks you got clash with others.

Built and maintained by Bhavesh Vala. Last reviewed . Every calculation uses the same tested rules as the subnet planner, including /31, /32 and IPv6. About