What makes a password strong, and how does the generator work?
The strength of a password is measured by the number of guesses an attacker needs to find it. Attackers do not guess letter by letter: they run lists of leaked passwords, dictionary words and predictable variations such as replacing a with @ or adding a year at the end. That is why a password a person “made up” is usually weaker than it looks, and a password chosen with true randomness is far stronger.
The strength of a random password is expressed as entropy, in bits: the password length multiplied by log2 of the number of possible characters. A 16-character password drawn from about 90 characters (uppercase and lowercase letters, digits and symbols) reaches about 100 bits, and every additional character multiplies the number of guesses required by several dozen. This is why length matters more than cleverness: adding characters improves strength more than any other trick.
The generator picks every character with crypto.getRandomValues, the browser's cryptographic random number generator, using a method that prevents statistical bias. In “Random password” mode at least one character from every type you selected is guaranteed, and the characters are then shuffled so their position is not predictable. In “Passphrase” mode, random words are chosen from a list of 450 English words, so each word adds about 8.8 bits, so a 6-word passphrase reaches about 53 bits, and with a random digit and more words the strength keeps growing.
The strength meter turns the entropy into a rating and an estimate of the average crack time, assuming 10 billion guesses per second, a rate that fits an offline attack on passwords stored with weak encryption. It is a conservative estimate for comparison, not a guarantee. A strong password is only one layer: use a unique password for every service, keep it in a password manager and turn on two-factor authentication wherever possible.
So which should you choose: a random password or a passphrase? For passwords that are stored in a password manager and pasted automatically, a random password of 16–20 characters is the simplest and strongest choice. For passwords you have to remember or type by hand (the master password of your password manager, the login to your computer or phone), a passphrase of 5–7 words is far more convenient and still strong. In both cases the rule is the same: the randomness has to come from the computer and not from your head, because people choose words and patterns that are more predictable than they think.
