Skip to content
Toolverse

Choosing a Strong Password: Length, Randomness and Entropy

Why length beats clever substitutions, what entropy in bits means, and how to combine generated passwords with a password manager.

Published

Password advice has changed a lot. The old rules — at least eight characters, one capital, one number, one symbol, change it every 90 days — produced passwords like Summer2024! that satisfy every checkbox and fall to an attacker in seconds. Modern guidance focuses on two things instead: randomness and length. This guide explains why, and how to put it into practice without having to memorise anything.

How passwords are actually attacked

Most accounts are not broken by someone typing guesses into a login page. Websites limit and block repeated attempts, so those online attacks are slow. The serious threats are different:

  • Credential stuffing. When one site is breached, attackers try the leaked email and password pairs on hundreds of other sites. If you reuse a password, one breach anywhere unlocks your other accounts. This is the most common way accounts are taken over.
  • Offline cracking. If a breach exposes hashed passwords, attackers can test guesses on their own hardware with no rate limit. Against fast hash functions, modern graphics cards can try billions of guesses per second. Well-run sites use deliberately slow algorithms such as bcrypt or Argon2, which cut that rate dramatically, but you cannot know how a site stores your password.

Cracking tools do not guess randomly. They start with lists of leaked passwords, dictionaries and names, then apply rules that mimic human habits: capitalise the first letter, add a year, swap a for @ and o for 0, put ! at the end. A password that feels clever to a person is usually one of the first few billion guesses.

Entropy: measuring unpredictability

Security people describe strength in bits of entropy. If a password is chosen uniformly at random from N possibilities, its entropy is log₂ N bits. Each extra bit doubles the number of possibilities an attacker must work through. For a random string of length L drawn from an alphabet of C characters, that is simply L × log₂ C.

Password typePossibilities per characterEntropy
6-digit PIN1019.9 bits
8 random printable characters9452.4 bits
16 random lowercase letters2675.2 bits
12 random printable characters9478.7 bits
16 random printable characters94104.9 bits
20 random printable characters94131.1 bits

Two lessons stand out. First, length is extremely effective: sixteen lowercase letters beat eight characters drawn from the full keyboard by more than 20 bits, which is a factor of over a million. Second, the formula only applies to passwords that really are random. A human-chosen password of the same length has far less entropy than the table suggests, because the attacker's rules capture the ways people choose.

What “random” has to mean

True randomness has to come from a machine, and from the right kind of machine. Ordinary programming functions such as Math.random() are designed for games and simulations, not secrets, and their output can sometimes be predicted. Browsers provide a separate cryptographically secure generator, crypto.getRandomValues, which draws on the operating system's entropy sources. The Toolverse Password Generator uses only that source.

There is a subtle second requirement: turning random numbers into characters without favouring any of them. The tempting shortcut is to take a random number modulo the alphabet size, but unless the alphabet size divides the random range evenly, the first few characters come up slightly more often. Our generator avoids that with rejection sampling: random values from the uneven tail of the range are thrown away and redrawn, so every character is exactly equally likely. The effect of modulo bias on a single password is small, but there is no reason to accept it.

How long is long enough?

For accounts where a password manager fills in the password for you, length costs nothing. Sixteen to twenty random characters gives you more than 100 bits, far beyond the reach of any brute-force attack, even against a poorly protected database. NIST's current digital identity guidelines (SP 800-63B) have moved in the same direction: they emphasise length over composition rules, require sites to accept long passwords and screen new ones against lists of known breached passwords, and advise against forcing periodic changes unless there is evidence of compromise.

If a site imposes awkward rules, such as banning certain symbols or capping length, adjust the generator to fit. Dropping symbols and adding a few characters keeps the entropy roughly the same.

Passwords you must remember: use a passphrase

A few passwords cannot live in a password manager: the manager's own master password, and perhaps your computer login. For those, a random passphrase of several words is easier to type and remember than a jumble of symbols. The Diceware method picks each word with dice from a list of 7,776 words, giving about 12.9 bits per word. Six words gives about 77 bits, which is very strong. The key word is random: a phrase you invent, like a song lyric or a favourite quote, is far weaker than its length suggests.

Put it together

  1. Use a reputable password manager and let it store everything.
  2. Give every account its own randomly generated password of 16 characters or more. Never reuse one.
  3. Protect the password manager with a long, random passphrase that you do not use anywhere else.
  4. Turn on two-factor authentication for important accounts, preferably with an authenticator app or a security key rather than SMS, and use passkeys where sites offer them.
  5. If a site you use reports a breach, change that password. With unique passwords, nothing else is affected.

Strength is not about clever tricks. It is about letting a good random generator choose, giving it enough length, and making sure a single leak can never cascade into the rest of your accounts.

Try it yourself