Password Entropy Calculator

Entropy measures how many equally likely passwords an attacker has to search, expressed as a power of two. A password drawn uniformly at random from an alphabet of C symbols and L symbols long carries L × log2C bits. Enter the length and the character sets — or the word count and wordlist size for a passphrase — and this calculator returns the bits, the total keyspace, the bits contributed per symbol, and how many more symbols you need to reach a policy target such as 80 bits. It also tells you where the number stops being true: entropy describes the generator, not the string.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
What are you measuringPick passphrase if the secret is built by picking whole words at random, as Diceware and EFF wordlists do.Random character password
Password lengthNumber of characters in the password, counting every character including any symbols.12 chars
Lowercase letters (26)Tick if the generator could pick a to z.Yes
Uppercase letters (26)Tick if the generator could pick A to Z.Yes
Digits (10)Tick if the generator could pick 0 to 9.Yes
ASCII symbols (32)The 32 printable ASCII punctuation marks, excluding the space character.No
Number of wordsHow many words the generator picks at random; separators and capitalisation add nothing unless they are also random.6 words
Words in the wordlist7,776 for a five-dice Diceware or EFF long list; 1,296 for the EFF short list. Use the published size, not your guess.7776 words
Policy targetThe strength your policy requires; the calculator reports the margin against it and the length that would reach it.80 bits
Custom alphabet size (overrides the tick boxes)Use this for an alphabet the tick boxes do not describe — 16 for hex, 32 for base32, 58 for Bitcoin base58. Leave at 0 to use the tick boxes.0 symbols
A person chose this, it was not generated randomlyTick to flag that the uniform-random assumption behind the formula does not hold, so the result is an upper bound.No

It returns

  • Entropy — The base-2 logarithm of the number of equally likely secrets the generator could have produced.
  • Alphabet size — Characters available per position, or words available per slot in passphrase mode.
  • Bits per symbol
  • Possible secrets (keyspace)
  • Symbols needed to reach the target
  • Margin against the target — Entropy minus the policy target. Negative means the target is not met.

The formula

H=Llog2(C)
keyspace=CL=2H
L=Hlog2(C)

In plain text: H = L · log₂(C)

  • HEntropy of the generated secret (bits)
  • LLength — number of characters, or number of words in a passphrase (symbols)
  • CAlphabet size — characters available per position, or words in the wordlist (symbols)

Valid only when every symbol is drawn independently and uniformly at random from the same alphabet. It is a property of the generator, not of the string it produced.

Updated Category Security, Cryptography & Risk Verified against published test cases Reading time 13 min

What a bit of password entropy actually is

Entropy counts the size of the search an attacker faces, on a logarithmic scale. If a generator can produce exactly 260 different passwords and every one of them is equally likely, the password carries 60 bits of entropy, and an attacker who has to try them all has 260 ≈ 1.15 × 1018 candidates. Each extra bit doubles that. This is Shannon's measure, applied to the special case where the distribution is uniform, in which case entropy collapses to the plain logarithm of the number of possibilities.

The word doing the heavy lifting is uniform. Entropy is a property of the process that made the secret, not of the characters in it. The string Tr0ub4dor&3 and the string correcthorse both have a definite number of characters, but neither has an entropy you can read off the page — you can only compute entropy if you know how the string was chosen. Run a password manager set to twelve characters from a 94-symbol alphabet and the answer is exactly 12 × log294 = 78.7 bits. Type something you invented and the honest answer is that no formula on this page applies.

That is why every serious guidance document has moved away from entropy scoring for user-chosen secrets. NIST SP 800-63B dropped composition rules and entropy estimates in favour of a length floor, generous maximum lengths, and screening against lists of previously breached passwords. Entropy remains exactly right for the case it was built for: secrets produced by a random generator, which is what every password manager and every Diceware roll produces.

Once you have the bits, converting to attack time needs one more number — the attacker's guess rate — which is what the password crack time calculator handles. Entropy is the part that depends only on you.

Why the formula is a multiplication of logarithms

Build the keyspace first and take the logarithm second; the formula then explains itself. Each of the L positions can hold any of C symbols independently, so the number of distinct passwords is C multiplied by itself L times: CL. Taking log base two converts a count into bits, and the exponent comes down in front: H = L · log2C.

Written that way, log2C is the entropy each individual symbol contributes, and total entropy is just that per-symbol figure added up L times. The per-symbol values are worth memorising, because they explain every argument about password policy:

  • Digits only, C = 10: log210 = 3.32 bits per character.
  • Lowercase only, C = 26: 4.70 bits.
  • Alphanumeric mixed case, C = 62: 5.95 bits.
  • All printable ASCII except space, C = 94: 6.55 bits.
  • A Diceware word from a 7,776-entry list, C = 7,776: 12.92 bits.

Two conclusions fall straight out. First, adding character classes is a weak lever: going from lowercase to the full 94-symbol set raises the per-character yield from 4.70 to 6.55 bits, a gain of 39%, and then it is exhausted — there is nothing left to add. Length is the strong lever, because you can pull it repeatedly. Adding four characters to a twelve-character lowercase password adds 4 × 4.70 = 18.8 bits, and you can add four more after that; upgrading that same twelve-character password from lowercase to the full 94-symbol set adds 12 × 1.85 = 22.3 bits once, after which the alphabet lever is spent.

Second, a passphrase is not magic; it is the same formula with a larger alphabet and a smaller L. Six words from a 7,776-word list gives 6 × 12.92 = 77.5 bits, essentially what thirteen mixed-case alphanumeric characters gives (13 × 5.95 = 77.4 bits), and it is far easier to type on a phone. What it must not be is chosen words. The 12.92 bits per word is the entropy of a die roll, not of your taste in vocabulary.

The last term the calculator reports, the length needed for a target, is the same equation rearranged: L = ⌈Htarget ÷ log2C⌉, rounded up because you cannot use two thirds of a character.

Worked example: twelve characters, mixed case and digits

Your password manager is set to generate twelve characters using lowercase, uppercase and digits, and your policy demands 80 bits. Work it through by hand.

  1. Build the alphabet. 26 lowercase + 26 uppercase + 10 digits = C = 62 symbols.
  2. Bits per character. log262 = ln 62 ÷ ln 2 = 4.12713 ÷ 0.693147 = 5.9542 bits.
  3. Total entropy. 12 × 5.9542 = 71.45 bits.
  4. Keyspace. 6212 = 3.2263 × 1021, which is the same as 271.45. Both ways of writing it describe the same 3.2 sextillion candidates.
  5. Compare with the target. 71.45 − 80 = −8.55 bits, so this misses the policy by about eight and a half bits — a factor of 375 in search effort.
  6. Fix it with length. ⌈80 ÷ 5.9542⌉ = ⌈13.44⌉ = 14 characters. Two more characters, and you land at 14 × 5.9542 = 83.36 bits.
  7. Or fix it with the alphabet. Adding the 32 ASCII symbols takes C to 94 and the per-character yield to 6.5546 bits, giving 12 × 6.5546 = 78.65 bits — still short. The length change works and the alphabet change does not, which is the general pattern.

Now do the same job with words. Six words from the EFF long list: 6 × log27,776 = 6 × 12.9248 = 77.55 bits, still under 80. Seven words gives 90.47 bits and clears it with room to spare. That is why published passphrase advice settles on six to seven words rather than four or five.

How many bits you actually need

The target depends entirely on how the secret is stored, because that determines how fast an attacker can guess. Bits alone mean nothing without a guess rate.

For a secret protected by a modern password hash — bcrypt, scrypt or Argon2 with sensible parameters — the attacker is throttled to something in the thousands or tens of thousands of guesses per second per GPU, and around 60 to 70 bits puts an offline attack out of reach of any budget you are likely to face. For a secret hashed with a fast unsalted function such as MD5, SHA-1 or NTLM, commodity hardware reaches the order of 1010 guesses per second and you want 80 bits or more. For a key that must resist a well-funded adversary for decades, use 128 bits, which is the symmetric security strength NIST SP 800-57 Part 1 treats as adequate beyond 2030.

Three rules of thumb make the number legible. Ten bits is a factor of about a thousand. Twenty bits is a factor of about a million. And every three or four extra bits roughly ten-times the search — precisely, log210 = 3.32 bits per factor of ten. So the difference between a 60-bit and an 80-bit password is a factor of a million in attacker effort, and the difference between 71 bits and 80 bits in the worked example is a factor of 375.

Where entropy stops being the right frame is credential stuffing and phishing. A 128-bit password reused on a site that leaks it is worth nothing, and a 128-bit password typed into a convincing fake login page is worth nothing. Entropy defends against guessing only. That is why NIST SP 800-63B pairs its length requirement with breach-list screening, and why the residual risk belongs in a broader model such as the one behind the annualised loss expectancy calculator rather than in a bit count.

Entropy in bits by length and alphabet

Each cell is length × log₂(alphabet size), rounded to one decimal. Alphabet sizes: digits 10, lowercase 26, mixed-case alphanumeric 62, all printable ASCII except space 94. The bottom rows use a 7,776-word list at 12.92 bits per word.
LengthDigits (10)Lowercase (26)Alphanumeric (62)Full ASCII (94)
6 chars19.928.235.739.3
8 chars26.637.647.652.4
10 chars33.247.059.565.5
12 chars39.956.471.578.7
14 chars46.565.883.491.8
16 chars53.275.295.3104.9
20 chars66.494.0119.1131.1
4 words51.7 bits
5 words64.6 bits
6 words77.5 bits
7 words90.5 bits
8 words103.4 bits

Read down a column to see what length buys and across a row to see what the alphabet buys. The alphabet lever stops at 94 symbols; the length lever does not stop.

This number is an upper bound for anything a person invented

The formula assumes independent uniform draws. Human-chosen passwords violate that assumption comprehensively: they start with a capital, end with a digit and an exclamation mark, use a dictionary word as the stem, and substitute characters in patterns that every cracking rule set already encodes. A password matching the pattern Word1234! nominally scores over 50 bits and falls to a rule-based dictionary attack in seconds. The same applies to substituting @ for a or 3 for e: hashcat has applied those rules by default for years. If the secret was not produced by a random generator, treat the figure above as a ceiling that the real strength sits far below.

Mistakes that inflate the number

  • Reading the alphabet off the output instead of the generator. C is the set of symbols the generator could have emitted at each position, not the set that happened to appear. A twelve-character password drawn from a 62-symbol pool still carries 71.45 bits even if no digit turned up in it, and a password containing one exclamation mark is not 94-symbol entropy unless the generator could have put a symbol in every position.
  • Counting a capitalised first letter as a full class. Capitalising position one adds exactly one bit, not 26 characters' worth. A deterministic transformation adds nothing at all.
  • Counting separators and padding in a passphrase. If you always join words with a hyphen, the hyphens are known to the attacker and contribute zero. Only randomly chosen separators add entropy, and then only log₂ of the number of separators you might have used.
  • Using a wordlist size you guessed. Diceware and EFF long lists hold 7,776 entries because they encode five dice; the EFF short list holds 1,296. Using 10,000 as a round number overstates each word by 0.36 bits.
  • Assuming your random source is random. Entropy derived from a weak or seeded generator is fiction. Use the operating system's cryptographic source, or physical dice.
  • Treating entropy as protection against reuse. Bits defend against guessing only. The same strong password on two sites is one breach away from being worthless on both.
  • Comparing bits across storage schemes. Seventy bits behind Argon2 and seventy bits behind unsalted MD5 are the same entropy and wildly different risks, because the attacker's guess rate differs by many orders of magnitude.

Entropy, key strength and where to go next

Password entropy and cryptographic key strength are measured in the same unit and mean the same thing, which makes the comparison useful. A 128-bit AES key has 128 bits of entropy because the key is drawn uniformly at random from 2128 possibilities. A password with 128 bits of entropy is exactly as hard to guess — but only if it is fed to the cipher directly, which it never is. In practice it passes through a key derivation function, and the KDF's cost parameters change the attacker's economics far more than a few extra bits do. The brute-force key search time calculator treats the pure key case, where no KDF slows the attacker down.

The other place these bits show up is the birthday bound. A hash function with an n-bit output resists collisions only to about n/2 bits, because the chance of a coincidence grows with the square of the number of samples — the same arithmetic as the hash collision probability calculator. Entropy has no such penalty: a guessing attack against a 128-bit password really does take 2127 attempts on average, because there is no birthday shortcut when you are searching for one specific value.

For policy work, the practical sequence is: pick the storage scheme first, because it fixes the guess rate; derive the entropy target from that rate and the time you need to hold out; then set a generated length that reaches the target with the alphabet your systems accept. Doing it in that order stops you arguing about symbol requirements, which the arithmetic above shows are worth under two bits per character even in the best case, while length is worth as much as you are willing to type.

Key terms

Entropy
For a uniform distribution, log₂ of the number of equally likely outcomes. Measured in bits; each bit doubles the search.
Keyspace
The count of possible secrets, CL. Entropy is its base-2 logarithm.
Diceware
A method of building passphrases by rolling five dice per word and reading the result from a 7,776-entry list, giving log₂7776 = 12.92 bits per word.
Security strength
NIST's term for the number of bits of work an attack requires. A 112-bit or 128-bit strength is the current target for long-lived symmetric secrets.
Composition rule
A policy requiring particular character classes. SP 800-63B advises against them because they push users toward predictable patterns that cost less entropy than they appear to add.

Frequently asked questions

How many bits of entropy is a strong password?

Aim for 60 to 70 bits when the secret is stored behind a slow hash such as bcrypt or Argon2, and 80 bits or more when it may be stored behind a fast hash such as MD5, SHA-1 or NTLM. Use 128 bits for anything that must resist a well-funded attacker for decades, which matches the symmetric security strength NIST SP 800-57 treats as adequate for long-term protection.

Does adding symbols make a password much stronger?

Less than most people expect. Moving from mixed-case alphanumeric (62 symbols) to full printable ASCII (94 symbols) raises the yield from 5.95 to 6.55 bits per character, about 10%. On a twelve-character password that is 7.2 extra bits. Adding two more characters instead gives 11.9 bits. Length beats alphabet at every length in the reference table.

Is a passphrase better than a random password?

It is easier to type and remember at the same strength, which is the real advantage. Six words from a 7,776-word list carries 77.5 bits, the same as thirteen mixed-case alphanumeric characters, and you can dictate it over a phone. The condition is that the words are picked by dice or by a cryptographic random number generator, never chosen by you, because self-chosen words are drawn from a far smaller effective vocabulary.

Can I compute the entropy of a password I already have?

Only if you know exactly how it was generated. Entropy describes the process, not the string. A password manager set to sixteen characters from a 94-symbol alphabet produced 104.9 bits, whatever the output looks like. A password you invented has no computable entropy, and any tool claiming to measure it from the characters alone is estimating how easily its own rule set would have found it.

Why does NIST no longer recommend entropy for password policy?

Because the estimate is unreliable for user-chosen secrets, which is the case the policy has to cover. SP 800-63B replaced composition rules and entropy scoring with a minimum length of 8 characters, support for at least 64 characters, no forced periodic changes, and screening against lists of compromised passwords. Entropy is still exactly correct for machine-generated secrets, which is the case this calculator addresses.

How many Diceware words do I need?

Six words from a 7,776-entry list gives 77.5 bits, and seven gives 90.5 bits. Five words is 64.6 bits, which remains sound behind a slow hash but is thin if the secret could end up behind a fast one. The published EFF long list is the usual choice; its short list of 1,296 words gives 10.34 bits per word, so it needs about a quarter more words for the same strength.

Does capitalising the first letter add entropy?

One bit, if you decided at random whether to capitalise it, and zero if you always do. The same applies to appending a digit or an exclamation mark: a fixed habit is known to the attacker and adds nothing, while a random choice among ten digits adds log₂10 = 3.32 bits. Deterministic decoration is the single most common way people overestimate their own passwords.

What alphabet size should I use for a hex or base64 string?

Use 16 for hexadecimal, 32 for base32, 64 for base64 and 58 for Bitcoin-style base58, entered in the custom alphabet box. That gives 4, 5, 6 and 5.86 bits per character. Encoding never creates entropy: a 128-bit key written as 32 hex characters is still 128 bits, because 32 × 4 = 128. If your figure exceeds the entropy of the underlying key, you have counted the encoding rather than the secret.

References