Home / Computer Science / Algorithms / Password Entropy (Bits of Security)

Formula & Calculator

Password Entropy (Bits of Security)

Password entropy estimates how hard a password is to guess, measured in bits. It equals length times the base-2 logarithm of the character set size. For example, an 8-character password using lowercase letters only has about 37 bits of entropy; adding uppercase, digits, and symbols raises it to about 52 bits. Each additional bit doubles the search space. It is used to evaluate password strength and to set security policies. Modern recommendations often exceed 60-80 bits.

Computer Science Cryptography Daily Life
VORZEP · CRYPTOGRAPHY & SECURITY TOOLS

Password Entropy Calculator

Solve the classic entropy relation E = L · log₂(N) for any of its three unknowns — password entropy, password length, or effective character-set size — with step-by-step math, a strength meter, and companion guessing-time estimates.

E = L · log₂(N)
Solve for
Entropy (E) The number of bits of security in the password, computed as length × log₂(alphabet size). 40 bits is weak, 60 bits is decent, 80 bits is strong, 128 bits is beyond brute-force by any foreseeable machine.
bits
Entropy must be greater than zero.
Password Length (L) Number of characters in the password. Every additional character multiplies the guessing space by the alphabet size. Typical: 8–12 for legacy policies, 16+ for strong passphrases, 20+ for high-value accounts.
chars
Length must be at least 1 character.
Character-Set Size (N) Number of distinct characters the password could be drawn from. Digits only = 10, lowercase = 26, alphanumeric = 62, printable ASCII = 95, full Unicode = much larger. If users pick from a smaller pool in practice, use that effective size.
symbols
Character-set size must be at least 2.
PASSWORD ENTROPY (E)
80.0 bits
2^80 possible passwords
STRONG — RESISTS OFFLINE BRUTE FORCE
E = L · log₂(N)
Step-by-step solution
Entropy vs. length
Current N N ÷ 2 N × 2
Entropy vs. character-set size
Current length L − 4 L + 4
Sensitivity
Companion security metrics
Entropy growth — live schematic
ENTROPY GROWTH · E = L · log₂(N) LENGTH L L = 16 L ALPHABET N N = 62 symbols E (bits) log₂(N) = 5.954 bits per character E = 16 × log₂(62) = 95.3 bits
Length multiplier Character-set size (log₂ converted to bits/char) Total entropy in bits
What the entropy relation really measures
Eentropy (bits)
=
Llength
×
log₂(N)bits per character

Length is the dominant lever

Because entropy is linear in L but logarithmic in N, adding characters is far more powerful than adding symbols. Going from 8 to 16 characters doubles the bits; going from a 62-character alphabet to a 95-character alphabet adds only log₂(95/62) ≈ 0.62 bits per character. A 16-character lowercase passphrase beats an 8-character "complex" password almost every time.

Character-set size is logarithmic

Every doubling of the alphabet adds exactly one bit per character. Digits (10) → lowercase (26) → alphanumeric (62) → printable ASCII (95) → extended (256) gives 3.32, 4.70, 5.95, 6.57 and 8.00 bits per character respectively. Past 95 the gains flatten sharply, which is why "use a symbol" policies add less than most people assume.

Real-world entropy is lower than theoretical

The formula assumes every character is chosen uniformly at random. Human-chosen passwords are not: they follow dictionary words, keyboard patterns, dates and leetspeak substitutions. A "12-character complex" human password may have only 30–40 bits of real entropy. Passphrase generators and password managers produce passwords that actually reach the theoretical value.

Guessing time doubles per bit

Adding one bit of entropy doubles the number of guesses an attacker must make. The relationship between entropy and crack time is exponential: 40 bits is minutes on a GPU rig, 60 bits is months, 80 bits is geological time, and 128 bits is beyond any known or foreseeable classical computer. This is why 128-bit security is the standard target for cryptographic keys.

How to Use This Calculator

The entropy relation links three quantities: E, L, and N. Pick which one you want the tool to solve, then fill in the other two.

1. Choose what to solve for

Pick E, L, or N from the toggle. The calculator rearranges E = L · log₂(N) automatically for whichever you choose.

2. Use realistic presets

Presets cover typical values: entropy from 28 to 128 bits, length from 6 to 24 characters, and character-set size from digits (10) to extended byte range (256).

3. Pick the right alphabet

Use the character-set presets: 10 for PINs, 26 for lowercase passphrases, 62 for typical alphanumeric passwords, 95 for full printable ASCII. If the password uses only a subset in practice, use the effective size — not the maximum available.

4. Read the result and verdict

The result card shows the entropy in bits plus the equivalent number of guesses (2^E), the strength verdict, and a colour-coded strength meter.

5. Check the schematic and charts

The schematic shows how length and alphabet size feed into the entropy result. The chart plots entropy against length for three alphabet sizes.

6. Switch to Advanced for depth

Advanced mode adds a chart of entropy vs. character-set size, a sensitivity check on a +1 change, and companion metrics including guess count, crack time at various speeds, and classification.

What This Tool Offers

Built around the classic entropy relation E = L · log₂(N), the fundamental link between password length, alphabet size, and brute-force resistance.

Three-way solving

Solve for entropy, length, or character-set size. The calculator rearranges the formula for whichever variable you choose.

Clean entropy schematic

A length-and-alphabet-to-entropy diagram with animated-looking flow arrows and live labels that scale with your inputs.

Strength verdict and meter

Each result is classified from very weak through weak, moderate, strong, very strong, to extreme, with a colour-coded badge and live meter bar.

Guess-count and crack-time hints

Each field shows the value converted to related units — total guesses for entropy, and equivalent entropy for length and alphabet size.

Dual comparison charts

Entropy vs. length for three alphabet sizes, plus an advanced entropy vs. alphabet-size chart for three lengths.

Reference tables

Bits per character by alphabet, entropy targets by account type, and a full variable reference table with unit notes.

Reference Tables & Conversions

A bits-per-character lookup, an entropy target grid, and typical values by account type.

Bits per character by alphabet size

symbols
bits/char
bits
N = 62 → log₂(N) = 5.9542 bits/char → 16 chars = 95.27 bits

Entropy Lookup at Various Lengths

Computed from E = L · log₂(N). Values in bits.

Length LN = 10 (digits)N = 26 (lowercase)N = 62 (alphanumeric)N = 95 (printable ASCII)N = 256 (extended)

Typical Entropy and Crack Time by Account Type

Representative targets. Crack times assume an offline attack at 10¹² guesses per second (a mid-range GPU cluster).

Account / useRecommended entropy (bits)EquivalentOffline crack time @ 10¹² g/sNotes
PIN / low-value~20 bits6 digits< 1 secondOnly acceptable with rate limiting and lockout
Legacy website password~40 bits8 lowercase~18 minutesWeak against offline attacks
Decent user account~60 bits12 alphanumeric~18 monthsAcceptable for low-value online accounts
Strong user account~80 bits16 alphanumeric~1.9 billion yearsStandard target for password managers
High-value / admin~100 bits20 alphanumeric~10²¹ yearsRecommended for privileged accounts
Cryptographic key128+ bits22 alphanumeric> age of universeBeyond classical brute force

Variable Reference

SymbolMeaningTypical rangeUnits
EPassword entropy20 – 128+bits
LPassword length6 – 64characters
NCharacter-set size10 – 256symbols
log₂(N)Bits contributed per character3.32 – 8.00bits/char
2^ETotal guess space size10⁶ – 10³⁸+guesses
GAttacker guess rate10⁶ – 10¹⁵guesses/second

What Does E = L · log₂(N) Measure?

The password entropy relation connects three quantities that describe the brute-force resistance of any password or key: the number of bits of uncertainty an attacker faces (E), the number of characters in the secret (L), and the number of distinct symbols each character is drawn from (N). Together they quantify how many guesses an attacker must make, on average, to find the secret by exhaustive search.

Password Entropy Formula

The defining relationship is:

E = L · log₂(N)

Rearranged to solve for the other two unknowns:

L = E / log₂(N)
N = 2^(E / L)

When the alphabet is a power of two — e.g. N = 256 — the formula simplifies to E = 8L, which is why one byte of key material equals eight bits of security.

Password Entropy Variables

SymbolMeaningNotes
EEntropy in bitsNumber of bits of uncertainty in the secret
LPassword lengthNumber of characters in the secret
NCharacter-set sizeNumber of distinct symbols each character may be
log₂(N)Bits per characterInformation contributed by each character drawn uniformly
2^EGuess spaceTotal number of possible passwords an attacker must try
GGuess rateAttacker's guesses per second; determines crack time as 2^E / G

How Each Variable Affects Security

Because the relation is linear in L but logarithmic in N, length and alphabet size are not equal partners. Doubling the length doubles the bits of entropy; doubling the alphabet size adds only one bit per character. In practice this means a long passphrase drawn from a small alphabet can easily beat a short password drawn from a large one. "correct horse battery staple" is four words from a ~7,776-word list, giving 4 · log₂(7776) ≈ 51.7 bits — comparable to a random 8-character alphanumeric password, but far easier to remember.

Real-world entropy is almost always lower than the formula suggests, because humans do not choose characters uniformly at random. Dictionary words, keyboard walks, dates, names, and predictable substitutions (a → @, o → 0) collapse the effective alphabet and length. The formula is therefore best understood as an upper bound — a ceiling on the security a password of a given structure can provide — not a guarantee. Password managers and passphrase generators produce secrets that actually reach the theoretical value.

Password Entropy Calculation Examples

Given: L = 16, N = 62 — solve for E
E = 16 × log₂(62) = 16 × 5.9542 = 95.27 bits
Given: E = 95.27 bits, N = 62 — solve for L
L = 95.27 / log₂(62) = 95.27 / 5.9542 = 16 characters
Given: E = 95.27 bits, L = 16 — solve for N
N = 2^(95.27 / 16) = 2^5.9542 = 62 symbols
Given: E = 80 bits — crack time at G = 10¹² guesses/second
Time = 2^80 / 10¹² seconds ≈ 1.2 × 10¹² seconds ≈ 38,000 years

Frequently Asked Questions

For most user accounts, yes — 80 bits is the standard target recommended by NIST and used by password managers. At 10¹² guesses per second, an 80-bit search takes on the order of 10¹² seconds, or about 38,000 years, and real-world attackers rarely sustain that rate against a well-hashed password. For high-value accounts, cryptographic keys, or anything protecting long-lived secrets, aim for 100–128 bits. Entropy above 128 bits gives no practical benefit against classical computers.

Because entropy is linear in length but logarithmic in alphabet size. Each extra character multiplies the guess space by N, so adding a character to a 16-character password multiplies the work by 62. Switching from lowercase-only (N=26) to alphanumeric (N=62) multiplies the per-character work by only 62/26 ≈ 2.4, about 1.25 bits. In practice, a 20-character lowercase passphrase (20 × 4.70 = 94 bits) beats a 12-character fully complex password (12 × 6.57 = 79 bits) by a wide margin and is easier to remember.

The formula assumes every character is chosen uniformly at random and independently. Humans do not do that. Passwords built from dictionary words, names, dates, keyboard patterns, or predictable substitutions have far less entropy than the formula suggests — often 20–30 bits less for a typical "complex-looking" password. The tool gives the theoretical maximum for a given length and alphabet; for a real password, use a strength estimator that models human patterns, or use a password manager to generate genuinely random secrets.

Use the size of the pool the password was actually drawn from, not the maximum the input field allows. Digits-only PIN = 10. Lowercase passphrase from a word list = the list size, not 26. Random alphanumeric = 62. Random printable ASCII = 95. Random bytes = 256. If you are not sure, use the smaller number — overestimating N overestimates security.

Crack time ≈ 2^E / (2 · G), where G is the attacker's guess rate in guesses per second. The factor of 2 reflects that on average the attacker finds the password halfway through the search space. At G = 10¹² g/s: 40 bits ≈ 18 minutes, 60 bits ≈ 18 months, 80 bits ≈ 38,000 years, 100 bits ≈ 2 × 10¹⁸ years, 128 bits ≈ 5 × 10²⁶ years. Real attackers also use dictionaries and pattern rules, which can reduce effective entropy by 20–30 bits for human-chosen passwords.

No — entropy is a property of the password itself, not of how it is stored. The hashing algorithm affects the attacker's guess rate G, and therefore the crack time, but not the number of bits of uncertainty. A password with 60 bits of entropy stored with bcrypt at cost 12 might take centuries to crack; the same password stored with unsalted MD5 would fall in minutes. Both statements are consistent because G differs by many orders of magnitude between the two algorithms.

A randomly generated passphrase — four or more words chosen uniformly from a large word list — typically has both high entropy and high memorability, which is the best of both worlds. A four-word passphrase from a 7,776-word list has 4 × log₂(7776) ≈ 51.7 bits; six words gives ≈ 77.5 bits; eight words gives ≈ 103 bits. A human-invented phrase like "ILoveMyDog2019!" has far less, because the words are predictable. Use a generator that picks words at random.

Calculating...

Variables

Symbol Quantity Unit
Entropy Password entropy bits
L Password length characters
N Size of character set used

What it means

Password entropy is a measure of the unpredictability of a password, expressed in bits. It quantifies the number of guesses required on average to crack the password via brute force. The entropy is calculated as E = L × log₂(N), where L is the length of the password and N is the number of possible characters (e.g., 26 lowercase, 52 alphanumeric, 95 printable ASCII). Higher entropy means exponentially more combinations to test. For example, an 8‑character password with 95 characters yields about 52.6 bits of entropy, meaning 2^52.6 ≈ 6.5 × 10^15 possible passwords. In practice, a minimum of 80 bits is recommended for security. The formula guides password policy creation: longer passwords and larger character sets increase entropy. However, dictionary attacks and common patterns reduce effective entropy. Understanding entropy helps in evaluating password strength and in designing authentication systems. It is also used in cryptographic key generation.

Worked example

Password Entropy – Two Examples

Real‑World
Scenario 1 – Simple Password: A password has 8 lowercase letters (a‑z). What is its entropy?
ParameterValue
L (length)8
N (character set)26
1Entropy = L × log₂(N) = 8 × log₂(26) ≈ 8 × 4.70 = 37.6 bits
Result 37.6 bits ⚠️ Weak – crackable
Scenario 2 – Strong Password: A 12‑character password using upper/lower/digits/symbols (94 characters). What is its entropy?
ParameterValue
L (length)12
N (character set)94
1Entropy = 12 × log₂(94) ≈ 12 × 6.55 = 78.6 bits
Result 78.6 bits ✓ Strong – 2^78.6 combinations
Key insight: Aim for at least 60‑80 bits of entropy for secure passwords – longer length and larger character sets increase entropy.

Common mistakes

  • Character set size N: Count the number of possible characters (e.g., 26 for lowercase, 52 for mixed case, 95 for printable ASCII).
  • Log base: Use log₂ (base‑2) to get bits.
  • Length L: The password length; longer passwords increase entropy linearly.
  • Entropy vs. security: Higher entropy means stronger resistance to brute‑force, but does not protect against other attacks (e.g., phishing).
  • Randomness: Entropy calculations assume truly random characters; predictable patterns reduce effective entropy.

Applications

Password entropy, measured in bits, is calculated as L × log₂(N), where L is the password length and N is the character set size. It quantifies the strength of a password against brute‑force attacks. Engineers use this formula to enforce password policies, to design authentication systems, and to educate users on choosing strong passwords. In security audits, entropy helps evaluate the resistance of passwords to cracking. Understanding this formula is also critical for implementing password hashing and key derivation functions, as well as for setting minimum complexity requirements. It is a fundamental concept in cybersecurity that directly impacts the security posture of any system.

  • Password policy design and enforcement
  • Authentication system security assessment
  • User education on password strength
  • Security audits and risk analysis
  • Design of password managers and generators