IP Range to CIDR

The exact blocks that cover a range, with nothing rounded in.

Two addresses, in either order. The answer covers exactly what you ask for and nothing either side of it.

One per line, or separated by spaces or commas. A bare address counts as a single-address block.

192.0.2.5 to 192.0.2.130

126 addresses

The blocks that cover it

Block First Last Addresses
192.0.2.5/32 192.0.2.5 192.0.2.5 1
192.0.2.6/31 192.0.2.6 192.0.2.7 2
192.0.2.8/29 192.0.2.8 192.0.2.15 8
192.0.2.16/28 192.0.2.16 192.0.2.31 16
192.0.2.32/27 192.0.2.32 192.0.2.63 32
192.0.2.64/26 192.0.2.64 192.0.2.127 64
192.0.2.128/31 192.0.2.128 192.0.2.129 2
192.0.2.130/32 192.0.2.130 192.0.2.130 1

These blocks cover the range exactly: no address outside it, and none inside it left out.

Most calculators round outward. Asked for 192.0.2.5 through 192.0.2.130 they either refuse, or answer 192.0.2.0/24 and quietly include 130 addresses you did not ask for. In a firewall allow-list that is not a rounding error. RFC 4632 only lets a block of 2^n addresses start at a multiple of 2^n, so the honest answer is a set of blocks, and sometimes that set is eight long.