The answer to this depends on size of the networks you are wanting to summarize and whether or not they are contiguous. For the sake of simplicity, let’s say you want to summarize the following into the smallest possible summary address:
When I do subnetting, I use a mental shortcut instead of going all the way down to binary. Instead, I used exponents using the following formula
2^X >= Y
This reads as “two to the Xth power greater than or equal to Y” where Y is the number of networks (or hosts) you are trying to solve for. X is the power of two necessary so that 2 to the Xth power is greater than or equal to the number of networks in question.
In our example, we are trying to solve for 10 networks (0 - 9). What power of 2 is necessary such that two to that number is greater than or equal to 10? The answer is 4, since 2^4 = 16. This gives us a value of X=4, but what exactly is X? X represents the number of bits that must be used, in this case, to represent the 10 networks for which we are summarizing.
This means that /20 mask (255.255.240.0) is the smallest possible mask that could cover 192.168.0.0 - 192.168.9.0. So the summary address for 10 networks would be: 192.168.0.0/20.
Note that it was NOT necessary to go all the way to a /16 summary in order to create the summary.