Password Entropy Explained: The Math Behind a Secure Password
"Entropy" is the number that quietly sits behind every strength meter, every security recommendation, and every "your password is too weak" warning you've ever seen. Most people have an intuitive sense that it means something like "randomness," but few know how it's calculated or, more importantly, why a password can look random and still have low real-world entropy. This guide breaks the concept down from first principles so you can actually judge password strength yourself, instead of just trusting a colored bar.
What entropy really means
Entropy, borrowed from information theory, measures uncertainty — specifically, how many equally likely guesses someone would need to make, on average, to land on the correct answer, assuming they know the method used to generate it but not the specific result. Applied to passwords, entropy asks: if an attacker knew exactly how this password was created (its length, and which character types it might include) but nothing else, how large is the space of possibilities they'd have to search?
This is a subtly different question from "does this password look random to a human?" A password can look chaotic and still be low-entropy if it was actually built from a predictable process, and a password can look plain and still be high-entropy if it was generated with genuine randomness and enough length. Entropy is about the size of the true search space, not the visual impression a string makes.
The entropy formula
Entropy in bits is calculated with a simple formula:
Two variables drive this number:
- Length (L): how many characters long the password is.
- Pool size (R): how many distinct characters could appear in any given position — 26 for lowercase-only, 52 with uppercase added, 62 with numbers added, and roughly 88 once common symbols are included.
The base-2 logarithm converts the total number of possible combinations (R raised to the power of L) into a count of "bits," where each additional bit represents a doubling of the search space. That logarithmic relationship is the key to understanding why length affects entropy so much more powerfully than pool size: length sits in the formula as a direct multiplier, while pool size only ever contributes through a logarithm, which grows far more slowly. Our article on password length vs complexity explores that trade-off in more depth.
Theoretical entropy vs effective entropy
Here's the detail most explanations skip: the formula above calculates theoretical entropy — the maximum possible search space, assuming every character was chosen with true, uniform randomness. It says nothing about whether the password was actually generated that way.
Consider a password like Summer2024!. Run through the formula naively, its length and character variety might suggest a moderate theoretical entropy score. But that number assumes each character was equally likely to be anything in the pool, when in reality this password is a common season name, a predictable year, and one of the most frequently used trailing symbols — a pattern that dictionary and rule-based cracking tools are specifically built to anticipate, as covered in how hackers crack passwords. Its effective entropy — the real number of guesses a practical attack would need — is far lower than the formula alone suggests.
A password generated by drawing each character independently and uniformly from the full pool, with no underlying word, name, or pattern, has no such shortcut. For that kind of password, theoretical and effective entropy are the same number, because there's nothing predictable left for an attacker to exploit beyond brute force.
Entropy by the numbers
To make this concrete, here's how entropy scales across a range of realistic length and character-pool combinations, mapped to the same strength tiers used by this site's own password generator:
| Length | Character pool | Approx. entropy | Strength tier |
|---|---|---|---|
| 6 characters | All types (pool 88) | ~39 bits | Weak |
| 10 characters | Upper + lower (pool 52) | ~57 bits | Fair |
| 12 characters | Letters + numbers (pool 62) | ~71 bits | Good |
| 14 characters | Letters + numbers (pool 62) | ~83 bits | Good |
| 16 characters | All types (pool 88) | ~103 bits | Strong |
| 20 characters | Lowercase only (pool 26) | ~94 bits | Strong |
Notice the last two rows: a 20-character password using only lowercase letters actually lands in the same "strong" tier as a 16-character password using every character type. That's the practical proof of the length-versus-complexity relationship — it's also exactly why passphrases, covered in passphrases vs passwords, can reach strong entropy while staying easier to recall than a shorter jumble of symbols.
It also helps to translate bits into a rough sense of time. Assuming a determined offline attack testing on the order of one billion guesses per second — a reasonable stand-in for a well-resourced attacker up against a fast, poorly protected hash — the 39-bit example above could fall in a matter of minutes, the 57-bit example stretches to a couple of years on average, and the 71-bit and higher examples move into tens of thousands to hundreds of millions of years. These are illustrative figures, not guarantees: the real-world number depends heavily on how a service stores passwords, and a slow, modern hashing algorithm can push even a moderate-entropy password's practical crack time far higher than this simple math suggests. What never changes is the trend — every additional bit doubles the work an attacker faces, which is why entropy is worth targeting directly rather than eyeballing.
Why humans are bad at generating entropy
People consistently overestimate how random their own password choices are. Left to invent a password from scratch, most of us reach for something memorable — a keyboard pattern, a name, a date, a favorite phrase with a digit tacked on — because true randomness feels, by definition, meaningless and hard to hold onto. That instinct is exactly what caps effective entropy well below the theoretical maximum for hand-picked passwords, no matter how "creative" the substitutions feel to the person making them.
A cryptographically secure random number generator has no such bias. It has no preference for memorable patterns, no tendency to repeat a favorite number, and no notion of what "looks" random — it simply draws each character independently from the available pool with equal probability. This is precisely the approach this site's own generator takes, using your browser's Web Crypto API rather than a predictable pseudo-random function, so the theoretical entropy shown really is the effective entropy too.
This gap between hand-picked and machine-generated randomness shows up consistently whenever large sets of real passwords are studied: the same handful of keyboard walks, sports teams, and "word plus year plus symbol" patterns reappear constantly, even among people who believe they've chosen something unpredictable. It isn't a failure of effort — it's simply how human memory and creativity work. We're drawn to patterns because patterns are what we're able to recall later, which is exactly the property a cracking dictionary is built to exploit and exactly the property true randomness has none of.
Applying entropy to your own passwords
A few practical takeaways make this math useful day to day:
- Aim for at least 60 bits for everyday accounts, and 90 or more for anything sensitive — email, banking, or your password manager's master password.
- Let a generator handle the randomness rather than inventing a password yourself, so effective entropy matches the theoretical number. See our guide on how to create a strong password.
- Consider a passphrase when you need something you'll actually type from memory, since several random words can reach a strong entropy score while remaining pronounceable.
- Treat entropy as one layer, not the whole picture. Even a high-entropy password benefits from two-factor authentication as a backstop, covered in our two-factor authentication guide.
Frequently asked questions
What is a good entropy score for a password?
As a rough guide: below 40 bits is considered weak, 40 to 60 bits is fair, 60 to 90 bits is good, and above 90 bits is considered strong against offline brute-force attempts. Higher-value accounts, like email or a password manager, deserve a target at the strong end of that range.
Does entropy account for dictionary attacks?
No. The standard entropy formula assumes every character was chosen uniformly at random. If a password is actually a common word or pattern with minor tweaks, its theoretical entropy looks fine on paper, but its real-world, effective entropy against an attacker using dictionaries and rules is much lower.
Can I calculate a password's entropy myself?
Yes. Multiply the password's length by the base-2 logarithm of the character pool size it was drawn from. It's easier to simply watch the live bits-of-entropy figure shown by a generator as you adjust length and character options.
Does a password checker calculate the same entropy this article describes?
A well-built checker uses the same length-times-log2(pool) formula as a starting point, then applies penalties for patterns and known-leaked passwords to estimate effective entropy — try this site's own Password Strength Checker to see both numbers side by side.
Is entropy the only thing that matters for password security?
No. Entropy measures resistance to guessing, but it says nothing about phishing, malware, or a breach at a company storing your password. Pair a high-entropy password with two-factor authentication and a password manager for complete protection.
Conclusion
Entropy gives password strength an actual number instead of a gut feeling, but the formula only tells the truth if the password behind it was genuinely random to begin with. A hand-picked password can look complex and still carry low effective entropy, while a generated one built from true randomness gets to claim its full theoretical strength. Use the formula to set a target, use a real random generator to hit it, and let two-factor authentication cover the rest.
Related articles
Password Length vs Complexity
The math behind entropy explains why a long password — or passphrase — beats a short, complicated one.
Read article →Passphrases vs Passwords
The entropy math behind random word phrases versus random characters, side by side.
Read article →How Hackers Crack Passwords
A clear look at brute force, dictionary attacks, and phishing — and how to defend against each one.
Read article →How to Create a Strong Password
A practical, step-by-step framework for building credentials that hold up against modern attacks.
Read article →Free tools for this guide
Password Generator
Create a strong, random password in one click, right in your browser.
Open tool →Passphrase Generator
Build a memorable Diceware-style passphrase with real entropy behind it.
Open tool →Password Strength Checker
See entropy, crack-time estimates, and tips for any password you type.
Open tool →