Key Space Size
Also known as number of possible keys · how many combinations · keyspace · b to the L · password combinations · PIN combinations · search space size · number of permutations with repetition · how many passwords
Units aren’t used in this calculation — every value is a plain number.
Enter your known values, leave one input blank, and solves for the missing one.
Learning zone
Every position in a secret can hold any of symbols, there are positions, and the choices are independent — so the number of distinct values is multiplied by itself times. That is the whole derivation, and it is the same counting argument as a combination lock or a licence plate.
The useful thing is which lever moves it. Length is an exponent and the alphabet is only a base. Adding one character to a password over the 95 printable ASCII characters multiplies the space by 95. Adding thirty-nine characters to the alphabet — going from the 26 lower-case letters to all 62 alphanumerics — multiplies it by , which sounds impressive until you notice that at it is worth about the same as adding two and a half characters. Length is the cheap lever and the strong one, and the whole "must contain a symbol and a number" tradition is a small correction applied where a large one was available.
Powers of two are worth recognising on sight, because that is the currency key sizes are quoted in. is about a thousand, about a million, about a billion, about a trillion. Every ten bits is another factor of a thousand, so is about and is about . A four-digit PIN, at 10,000 values, is roughly — and it is not a joke, because a PIN lives behind a card that swallows itself after three tries. The size of the space only matters alongside how fast anyone can walk it.
Now the honesty, and it is the same caution that governs three pages in this section. This count is an upper bound on the work an exhaustive search needs. It is not an estimate of the work a real attack needs, and the gap between the two is enormous for anything a person chose. Real password recovery starts from leaked corpora — hundreds of millions of real passwords, ranked by how often they appeared — and applies mangling rules that capitalise, append a year, and substitute the digits people substitute. Against a human-chosen password, the effective space is the dictionary and its rules, which is a number in the billions rather than the the arithmetic offers. The count above is honest exactly when a random generator did the choosing, and only then.
One quiet arithmetic point that catches people out. If you are told "eight characters, must include an upper-case letter, a lower-case letter, a digit and a symbol", the space is smaller than , not larger — every composition rule removes candidate passwords. The rules exist to stop people choosing "password", which is a reasonable goal, but they do it by shrinking the space rather than growing it. NIST SP 800-63B dropped composition rules and mandatory rotation from its guidance for exactly this reason, and recommends screening against known-breached passwords instead.
- = Key space size (keys)
- = Alphabet size (symbols)
- = Length (symbols)
- Key space size — Birthday Collision Probability (Exponential Approximation), Password Entropy (Uniform Random Generation)
- Alphabet size — Password Entropy (Uniform Random Generation), Birthday Collision Probability (Exponential Approximation)
- Length — Password Entropy (Uniform Random Generation), Reed-Solomon Correctable Errors