Work out ip range to cidr instantly with clear inputs, formula shown and shareable results.
An arbitrary address range rarely maps to one CIDR prefix, because every prefix must start on a boundary that is a multiple of its own size. The greedy algorithm takes the largest aligned block that fits at the current address, emits it, and repeats until the end of the range is reached — which is exactly how firewall and ACL generators expand a range.
Greedy CIDR decomposition
at each address take the largest 2^k block where address mod 2^k = 0 and address + 2^k - 1 <= end; repeat
Alignment. 192.168.1.10 is not a multiple of 8, so the first block can only be a /31 or /32 until the pointer reaches an aligned boundary.
Choose a start address that is a multiple of the block size and an end address one below the next boundary — for example 192.168.1.0 to 192.168.1.255 is exactly one /24.