What this password generator does
The generator creates random passwords from the character sets you choose, using the cryptographically secure random number generator built into your browser. It can make up to ten at once, guarantees at least one character from each set you tick, can leave out characters that are easy to confuse, and shows the strength of the result in bits of entropy. Passwords are created on your device and are never sent or stored.
How to generate a password
- Set the length. 20 characters is the default; any length from 4 to 128 works.
- Choose how many passwords you want.
- Tick the character sets. Some sites reject certain symbols; untick Symbols for those and add a few characters of length instead.
- Tick Avoid look-alike characters if the password will be read aloud or typed from paper.
- Press Generate and copy the password straight into your password manager.
How the randomness works
Each character is picked with crypto.getRandomValues, part of the Web Crypto API, which draws from the operating system's secure random source. A random 32-bit number must then be mapped to one of the characters in the pool. The obvious method, taking the number modulo the pool size, is slightly biased: 232 is not a multiple of 84, so the first few characters would come up a tiny bit more often. The generator instead uses rejection sampling: it computes the largest multiple of the pool size below 232 and discards any random value above it, so every character is exactly equally likely.
To make sure every chosen set appears, the generator draws a complete password and checks it. If a set is missing, the whole password is thrown away and a new one is drawn. Fixing a missing character by hand would make some positions predictable; redrawing keeps every accepted password equally likely.
Entropy
entropy (bits) = length × log2(pool size)
| Character sets | Pool | Bits per character |
|---|---|---|
| Lowercase only | 26 | 4.70 |
| Lower, upper and numbers | 62 | 5.95 |
| All four sets | 84 | 6.39 |
| All four, look-alikes removed | 78 | 6.29 |
The figure is an upper bound: requiring each set removes a small share of possible passwords. The labels used are below 50 bits weak, 50 to 79 fair, 80 to 99 strong, and 100 or more very strong.
Worked examples
The default 20 characters
20 characters from all 84 gives 20 × 6.39 = about 127 bits. A 16-character password from the same pool gives about 102 bits.
Letters and digits only
A site that forbids symbols still allows 62 characters. 12 of them give about 71 bits; 16 give about 95.
What the bits mean
An attacker testing a trillion guesses per second against a stolen hash needs on average 279 ÷ 1012 seconds to find an 80-bit password, which is about 19,000 years. A 64-bit password would fall in about 107 days at the same rate.
Tips and common mistakes
- Use a different password for every account. Reuse is how one leaked site becomes many hacked accounts.
- Let a password manager remember them. A random password you cannot remember is fine as long as it is stored safely.
- Length beats complexity. Adding characters raises entropy faster than adding symbol types.
- Turn on two-factor authentication. A strong password does not protect you from phishing; a second factor helps.
- For a master password, consider a passphrase. Six words chosen at random from a 7,776-word list give about 77.5 bits and are easier to type.
Limits and privacy
The page needs a browser with the Web Crypto API, which every current browser has. The passwords exist only in this page until you leave or generate new ones; they are not saved, logged or transmitted. Your device's security still matters: malware or a shared screen can expose a password however it was made.