Password Entropy Explained: How to Actually Calculate How Strong a Password Is
"Use a strong password" is common advice, but "strong" is vague. Entropy is the actual measurement behind it β a number, in bits, that tells you how many guesses an attacker needs in the worst case. This article explains what that number means and how to calculate it for a password you're actually choosing.
TL;DR
- Entropy (in bits) measures the size of the search space an attacker must brute-force through:
entropy = log2(charset_size ^ length). - Every additional character multiplies the search space; every additional character type only multiplies it by a fixed, comparatively small factor.
- A 12-character password using only lowercase letters has less entropy than an 8-character password mixing all four character types β but a 20-character lowercase passphrase beats both.
- CSPRNG-generated passwords hit their theoretical entropy exactly; human-chosen passwords rarely do, because humans aren't random.
Short Answer
Entropy in bits is log2(N), where N is the total number of equally likely passwords of that length and character set. In practice: entropy = length Γ log2(charset_size). A 16-character password drawn uniformly from the 95 printable ASCII characters has roughly 16 Γ log2(95) β 105 bits of entropy β comparable to a 256-bit AES key's practical brute-force resistance is overkill by comparison, but 105 bits is already far beyond what any current or foreseeable hardware can exhaust. PassGenerate generates passwords this way, using the Web Crypto API's CSPRNG so the entropy figure is real, not just theoretical.
The Entropy Formula, Worked Through
Entropy assumes every character is chosen independently and uniformly at random from a fixed set. Given a character set of size C and a password of length L, the number of possible passwords is C^L, and the entropy in bits is:
entropy = L Γ log2(C)
| Character set | Set size (C) | Bits per character (log2 C) |
|---|---|---|
| Digits only (0-9) | 10 | 3.32 |
| Lowercase letters (a-z) | 26 | 4.70 |
| Lowercase + digits | 36 | 5.17 |
| Mixed case + digits | 62 | 5.95 |
| Mixed case + digits + symbols (~33 common) | 95 | 6.57 |
Length vs. Character-Set Size: Why Length Wins
This table shows why NIST SP 800-63B de-emphasizes forced complexity rules in favor of length:
| Length | Digits only | Lowercase | Mixed letters+digits+symbols |
|---|---|---|---|
| 8 | 27 bits | 38 bits | 52 bits |
| 12 | 40 bits | 56 bits | 79 bits |
| 16 | 53 bits | 75 bits | 105 bits |
| 20 | 66 bits | 94 bits | 131 bits |
| 24 | 80 bits | 113 bits | 157 bits |
| 32 | 106 bits | 150 bits | 210 bits |
Notice that an 8-character password using all four character types (52 bits) has less entropy than a 12-character all-lowercase password (56 bits). This is the mathematical basis for a well-known finding: adding four more random characters does more for your security than forcing symbols and digits into a short password. It's also why long, randomly generated passphrases (several random dictionary words) can be both stronger and easier to type than a short jumble of symbols β each additional word typically adds 11-13 bits if drawn from a list of a few thousand words, which adds up quickly across 4-6 words.
What This Looks Like With Real Hardware
The bit counts above are useful for comparison, but they don't tell you how long an actual attack takes β that depends on the hardware doing the guessing, and that hardware gets faster every year. Hive Systems publishes an annual benchmark of exactly this, testing brute-force speed against a rented fleet of consumer GPUs. Their 2026 table puts a randomly generated 8-character password using the full mixed character set (upper, lower, digits, symbols) at roughly 132 years to crack β down from 164 years in 2025 and 225 years in 2024, a drop of about 20-25% per year as GPU hardware improves. An 8-character password using lowercase letters only fell even faster: from three weeks to crack in 2025 to about two weeks in 2026.
Two things from that benchmark are worth knowing. First, the trend is one-directional β whatever "safe" looks like today gets weaker every year purely from hardware improvements, which is a real-world argument for erring toward longer passwords rather than the current minimum. Second, and somewhat counterintuitively, the specialized AI accelerator chips built for training language models turned out to be no faster at brute-forcing passwords than equivalent gaming GPUs, and in some tests slower β password cracking is a raw numbers problem that doesn't benefit from the matrix-multiplication optimizations AI hardware is built around.
Why "Random-Looking" Isn't the Same as Random
Entropy calculations assume true uniform randomness. Human-created passwords systematically fail this assumption even when they look complex: keyboard walks (Qwerty123!), leetspeak substitutions (P@ssw0rd), and dates or names appended with a symbol all reduce the effective entropy far below what the character count suggests, because attackers' cracking tools are built around exactly these patterns. A password can look random to a human eye and still fall in the first few million guesses of a targeted dictionary attack.
This is the practical reason to prefer a generator using a cryptographically secure pseudorandom number generator (CSPRNG) over inventing a password yourself. Math.random() in JavaScript is not cryptographically secure and is unsuitable for password generation β it's seeded and generated by an algorithm that's predictable enough to be reconstructed from a handful of outputs in some engines. The Web Crypto API's crypto.getRandomValues() draws from the operating system's cryptographic randomness source, so each character is genuinely, independently random and the entropy math above actually applies.
How Many Bits Do You Actually Need?
There's no single universal number, because it depends on what you're defending against:
- ~40-60 bits: Resistant to casual guessing and small-scale automated attacks, but within reach of a well-resourced offline attack against a weakly-hashed database. Adequate only for genuinely low-value, low-consequence accounts.
- ~70-90 bits: Comfortably beyond brute-force range even against optimized cracking hardware for any realistic attack timeframe. A reasonable target for most personal accounts.
- 100+ bits: Effectively unreachable by brute force with current or foreseeable computing, cryptographic in the same sense as a strong encryption key. Appropriate for your password manager's Master Password or other single points of failure.
Key Takeaways
- Entropy is
length Γ log2(character_set_size)β length has a linear effect, character-set size has a logarithmic one, which is why length dominates. - A short password with every character type can have less entropy than a longer password with only one.
- Effective entropy only equals theoretical entropy when characters are genuinely, uniformly random β which is what a CSPRNG guarantees and human choice generally doesn't.
- Target 70+ bits for everyday accounts and 100+ bits for master passwords or other single points of failure.
Why You Can Trust PassGenerate
- Passwords are generated locally in your browser using the Web Crypto API.
- No passwords are transmitted to servers.
- Uses a cryptographically secure pseudorandom number generator (CSPRNG).
- Follows modern security best practices recommended by NIST and OWASP.
References
- Hive Systems 2026 Password Table (brute-force benchmark data)
- NIST SP 800-63B β Digital Identity Guidelines
- OWASP Authentication Cheat Sheet
- MDN Web Crypto API Documentation
Bottom Line
Entropy is a precise, calculable measure of password strength, not a vague notion of "complexity." Length matters more than forced character-type mixing because it grows the search space linearly while character-set size only grows it logarithmically β and none of the math holds unless the characters are actually random, which is why a CSPRNG-backed generator like PassGenerate produces passwords that hit their theoretical entropy exactly, something a human-chosen password essentially never does.