Skip to content
mathbehind

Password Entropy Calculator

Measure the strength of a randomly generated password in bits of entropy, and see how long it would take to guess at different attack speeds.

Your numbers

characters

Entropy

71.5 bits

Average time to guess

5,112 years

Possible passwords
3.23 × 10^21
Bits per character
5.95
The math behind it
  1. Bits per character

    log₂ 62equals5.95

  2. Entropy

    12 × 5.95equals71.5 bits

  3. Average time

    62¹² ÷ 2 ÷ 10,000,000,000/sequals5,112 years

Password entropy measures how many guesses an attacker would need, expressed in bits. Each extra bit doubles the work. It is the most honest way to compare password rules, as long as the password is truly random.

How it works

A password of length L drawn at random from N possible characters has N^L possible values. Entropy is log2(N^L) = L × log2(N) bits.

On average an attacker finds a random password after trying half of all possibilities, so the average time is N^L ÷ 2 ÷ guesses per second.

Attack speed depends on the situation. Online logins are usually rate-limited to a few guesses a second. If a site's password database is stolen, attackers guess offline, and speed depends on how the passwords were hashed: slow hashes like bcrypt allow thousands of guesses a second, fast ones allow billions.

A worked example

A 12-character password using letters and digits has 62^12 = 3.23 × 10^21 possibilities, which is 12 × log2(62) = 71.5 bits of entropy. At 10 billion guesses a second, finding it takes about 5,100 years on average.

Questions people ask

Does this apply to passwords I make up myself?

No. The math assumes every character is chosen at random. Human-chosen passwords follow patterns, such as words, names and years, that attackers try first, so their real strength is far lower than this shows.

Is length or complexity more important?

Length. Adding symbols raises bits per character from about 5.95 to 6.57, while each extra character adds a full 5.95 or more. A longer password of letters and digits usually beats a shorter one with symbols.

How many bits of entropy is enough?

About 60 bits resists offline guessing against well-hashed passwords for a long time, and 80 bits or more is comfortable even against fast hashes. A password manager generating 16 or more random characters clears both easily.