# How many unique house keys can possibly exist?

Here is a very short Youtube Video on how keys work. Given the space available for the length and number of the pins, and operational room for error there are only so many key combinations possible. Given all the different variables involved it's certainly possible for every person on the planet to have a unique lock, it's highly impractical.

Most vendors distribute key/lock combinations by region. Car companies (or house door lock manufacturers) for example might have 200,000 possible key/lock pairs but could redistribute the same combinations on both the east and west coasts since the likelihood of 2 people with the same key/lock combos meeting and then realizing they're the same are extremely low. Generally keys are created using "codes" where a number represents the height of the peaks on the key.

So given say 5 pins with say 10 different height possibilities you're looking at 10^5 unique possibilities. You can then add another dimension of complexity by putting ridges on the sides of the keys. I think you see where this is going. A lock could have more pins or more height possibilities depending on manufacturing accuracy and size of the lock.

If someone was to somehow have every possible key combination in one place, there is NO WAY they would be able to transport it. Let alone go unnoticed. It would take multiple dump trucks to move even a portion of the keys.

Pictured below is a key decoder, used by lock smiths to identify the height of each cut in a key, allowing the key smith to determine the code used to describe a particular key.

As you can see, different companies use different sets of codes, Kwikset having only 8 possible codes (0 through 7) and Weslock having the most with 11 (for this subset of all lock manufacturers), with each code referring to a particular cut depth. While the math has already been described and corrected in other answers and the complexities of key design have been referenced through a (peer-reviewed?) paper, this key decoder gives some confirmation to the numbers previously used, stating there are about 10 possible cut depths on a key.

There's paper on the subject available to read at jstor.org and the answer isn't quite as simple as `{the number of cuts}^{possible cut depths}`

because there are cases where one cut will remove the possibility of an adjacent depth and so forth. It does get complicated though! There are so many different factors to take into account that it's likely each lock/key combo is pretty unique although some cheap padlocks could have the same shape if the manufacturer is cutting corners.