Turning 192.168.1.10 to 192.168.1.20 into four CIDR blocks
A CIDR block is a run of addresses with two rules. Its size is a power of two (1, 2, 4, 8 and up), and it starts on a multiple of its own size. A block of 4 can start at .8 or .12 but not at .10. A range you are handed, from a vendor or a log, follows neither rule, so the job is to cover it with blocks that do, and to use as few as possible.
Work through 192.168.1.10 to 192.168.1.20 by hand, looking only at the last number, 10 to 20. That is 11 addresses. Start at 10. The biggest block that may start at 10 is size 2, because 10 is a multiple of 2 but not of 4. A block of 2 covers 10 and 11, which is inside the range, so the first block is 192.168.1.10/31. A /31 is 32 minus 1 bits of network, which is a block of 2.
Next is 12. Twelve is a multiple of 4 but not 8, so the biggest block that can start there is 4, covering 12 to 15. That fits, so the second block is 192.168.1.12/30. Next is 16, a multiple of 16. A block of 16 would run to 31, and one of 8 would run to 23, both past 20. A block of 4 runs 16 to 19, which fits: 192.168.1.16/30. Last is 20. A block of 4 or 2 would run past 20, so it is a single address, 192.168.1.20/32.
Four blocks: 192.168.1.10/31, 192.168.1.12/30, 192.168.1.16/30 and 192.168.1.20/32. Add up their sizes, 2 + 4 + 4 + 1, and you get the 11 addresses you started with, with none outside the range. Type the two addresses into the boxes above and the same four blocks appear, each with the addresses it covers written under it.
The greedy rule, take the biggest block that is aligned and fits, always gives the fewest blocks, which is why firewall vendors and the standard libraries of Python and Go use it. It also shows why a range like 0.0.0.1 to 255.255.255.254 needs 62 blocks: it starts and ends one address away from a perfect /0, and each edge costs one block per bit.
The limits are simple. This page converts IPv4 ranges; IPv6 ranges are not supported here yet. It covers one range at a time, so to merge several overlapping ranges, convert each and deduplicate. And a CIDR list is only as good as the range you give it: check that the range you were sent is really inclusive at both ends, because an "end" address that someone meant as exclusive adds one address too many.