Guides › Text & developer

Longer or more complex? What actually makes a random password strong

Password rules have taught people that "P@ssw0rd!" is stronger than "correct horse battery staple" (a phrase popularised by the webcomic xkcd). For passwords people invent themselves, both are weak, because attackers guess common patterns first. For randomly generated passwords, though, strength can be calculated exactly, and the calculation gives a clear answer to the question of length versus complexity. We did the arithmetic for the settings our password generator offers.

Short answer: each extra character adds strength; each extra character type adds much less. A 16-character password of only lowercase letters and digits (83 bits) is stronger than a 12-character password using every symbol on the keyboard (79 bits). For accounts that matter, use a random password of at least 16 characters from a password manager, and turn on two-factor authentication.

How strength is measured

For a password chosen uniformly at random, strength is measured in bits of entropy: the number of yes/no questions an attacker would need to pin it down. It equals the length multiplied by log2 of the number of possible characters. Each extra bit doubles the number of possible passwords, so 80 bits is not "a bit more" than 70; it is about a thousand times more.

0501008 chars12 chars16 chars20 charsDigits onlyLowercase lettersLowercase + digitsUpper + lower + digitsUpper + lower + digits + the 23 symbols our generator offersAll printable ASCIIbits
Entropy in bits by length and character set — chart drawn from the table below.
Character setSizeBits per character8 chars12 chars16 chars20 chars
Digits only (PIN)103.3227405366
Lowercase letters264.7038567594
Lowercase + digits365.17416283103
Upper + lower + digits625.95487195119
Upper + lower + digits + the 23 symbols our generator offers856.415177103128
All printable ASCII (for comparison; more symbols than our generator uses)946.555279105131
040801208121620Password length (characters)Entropy (bits)Digits onlyLowercaseAll 85 characters
Three rows of the table above. Each extra character adds a fixed number of bits, so length keeps paying off: 20 randomly generated lowercase letters (94 bits) beat 12 randomly generated characters from our 85-character set (77 bits).

Read across a row and the number climbs quickly; read down a column and it climbs slowly. Going from 62 to 94 characters adds only 0.6 bits per character. Adding four characters to a 12-character password adds about 19 to 26 bits for any set that includes letters.

What the bits mean in time

How fast an attacker can guess depends on the situation. Online, a website can slow or block repeated attempts, so even modest passwords survive. The real danger is an offline attack after a database leak, where guesses are limited only by hardware and by how the site stored the password. To make the numbers concrete, we assumed an attacker who can test 10 billion guesses per second, which is realistic for a stolen database protected by a fast, outdated hash, and calculated how long it takes on average to find a random password (half of all possibilities).

EntropyExampleAverage time to crack at 1010 guesses/s
38 bits8 lowercase lettersabout 10 seconds
52 bits8 characters, any symbolabout 3.5 days
62 bits12 lowercase + digitsabout 7.5 years
71 bits12 mixed-case + digitsabout 5,100 years
83 bits16 lowercase + digitsabout 13 million years
95+ bits16 mixed-case + digitsfar longer than the age of the universe

Sites that store passwords properly, with slow hashing functions such as Argon2, scrypt or bcrypt as OWASP recommends, cut the guessing rate by many orders of magnitude, but you cannot know how a site stores yours. A long random password protects you either way.

Why the rules on websites are changing

The US standards body NIST now tells organisations not to force mixtures of character types and not to require periodic changes without evidence of compromise. Its current guidelines set minimum lengths instead, require sites to accept long passwords (at least 64 characters), and ask them to block passwords found in breach lists. The reasoning matches the table: forced complexity mostly produces predictable substitutions like "@" for "a" and "1" at the end, while length genuinely adds strength.

Passphrases

A passphrase made of random words is easier to type and remember. The EFF's dice wordlist has 7,776 words, so each word adds 12.9 bits: four words give 51.7 bits, five give 64.6 and six give 77.5. That means a six-word passphrase is about as strong as a 12-character password from the full keyboard, and much easier to type on a phone. The words must be chosen randomly, with dice or a generator; a phrase you think of yourself, such as a song lyric, is far weaker than its length suggests.

Practical settings

UseRecommended setting
Accounts stored in a password manager20 characters, all character types (about 128 bits with our generator); you never type it
A password you must type on a TV or game console16 characters, lowercase + digits (83 bits); avoids awkward symbols
The master password of your password managerA random passphrase of 6 words or more
Wi-Fi network password16+ characters without look-alike characters (0/O, 1/l), so guests can type it
Site rejects symbols or limits lengthUse the maximum length it allows with the characters it accepts

What strength cannot fix

Our generator creates passwords in your browser with the cryptographic random generator and does not send or store them. Copy the result straight into your password manager.

Common questions

Do the entropy numbers apply to passwords I made up?

No. They apply only to passwords chosen randomly by a generator. Human-chosen passwords follow patterns that attackers try first, so their real strength is much lower than their length and character mix suggest.

Should I add a symbol if a site requires one?

Yes, meet the rule, but get your strength from length. A generated password that already includes symbols satisfies most rules automatically.

Is it safe to generate passwords in a web page?

It is if the page generates them locally with the browser's cryptographic generator and does not transmit them, as ours does. Avoid any generator that sends the password to a server or shows ads inside the result.

References

  1. NIST SP 800-63B-4: Digital Identity Guidelines, Authentication and Authenticator Management
  2. EFF Dice-Generated Passphrases and long wordlist (7,776 words)
  3. OWASP Password Storage Cheat Sheet
  4. Have I Been Pwned: Pwned Passwords

Written and checked by Ria Kim for GlowHalo; figures without a source link come from the steps shown on this page. Companion tool: Password Generator. Spotted an error? Write to help@glowhalo.org.

More guides

Text & developerUUID v4 or v7 as a database primary key? We inserted a million rows of eachRandom v4 keys were 3–4.7 times slower to insert than time-ordered v7 keys in our SQLite test. What causes the gap and when it matters.Read guide →Text & developerIs your random picker really fair? Modulo bias, measured on 6.2 million drawsA common shortcut made eight characters 25% more likely than the rest in our test. How fair random picks are made, and how to check a tool.Read guide →Text & developerHow big should a printed QR code be? What data length and error correction do to itWe generated QR codes for five real payloads at all four error-correction levels and counted the modules. Shorter data matters more than anything else.Read guide →