How the generator picks each character
Every character comes from crypto.getRandomValues, the random number source your browser uses for encryption. It is designed to be unpredictable, unlike Math.random, which is fine for games but not for secrets.
Turning a random number into a character needs care. Say you take a random byte (0 to 255) and divide by 94, the number of characters on offer. The remainder picks the character. But 256 is not a multiple of 94, so the first 68 characters would come up slightly more often. This is called modulo bias. The generator avoids it by throwing away the few random values that would cause it and drawing again. Every allowed character is exactly as likely as every other.
When Include at least one of each selected type is on, the generator builds the whole password and checks it. If a type is missing, it throws the password away and starts again. That keeps every valid password equally likely. The shortcut many tools take, forcing one digit and one symbol into the password, makes some patterns more likely than others.
How strength is measured
Strength is shown as entropy in bits: the number of possible passwords, written as a power of two. For random characters the formula is:
L is the length and N is the number of characters in the pool. Each character adds log2(N) bits:
| Characters allowed | Pool size (N) | Bits per character |
|---|---|---|
| Lowercase only | 26 | 4.70 |
| Lowercase and uppercase | 52 | 5.70 |
| Letters and digits | 62 | 5.95 |
| Letters, digits and symbols | 94 | 6.55 |
| All four, look-alikes removed | 84 | 6.39 |
Worked example. A 16-character password from all 94 characters has 16 × 6.555 = 104.9 bits. Requiring every type removes the passwords that miss one, such as those with no digit. That trims the total to 104.6 bits, so the rule costs almost nothing at this length. The tool counts the remaining passwords exactly instead of guessing.
For passphrases, every word comes from a list of 4,096 words, and log2(4,096) = 12:
Six words give 72 bits. The Add a random digit option puts one digit (10 choices) on one of the words (6 choices), adding log2(60) = 5.9 bits, for 77.9 in total. Capitalising every word adds nothing, because an attacker can simply assume it.
How long would it take to crack?
On average, someone guessing at random finds a password after trying half of all possibilities:
The speed depends on the attack. Guessing through a login page is slow, because good sites limit attempts. Guessing against a stolen database is much faster, and the speed depends on how the site stored the passwords. A slow hash such as bcrypt might allow about 10,000 guesses a second. A fast hash such as MD5 on a rig of graphics cards can reach around 100 billion.
| Password | Entropy | 10,000 guesses/s | 100 billion guesses/s |
|---|---|---|---|
| 8 lowercase letters | 37.6 bits | about 4 months | about 1 second |
| 6-word passphrase | 72 bits | about 7.5 billion years | about 750 years |
| 16 characters, all types | 104.6 bits | far longer than the universe’s age | about 5 trillion years |
These numbers only apply to passwords made at random, like the ones here. A password you have used before, or one that leaked in a breach, is tried first and falls instantly, however long it is.
Password or passphrase?
- Use a random password for accounts you open through a password manager. Length is free there, so 16 to 20 characters is easy.
- Use a passphrase for the few passwords you must type or remember: your password manager, your computer login, your phone backup. Pick at least six words; seven or eight for a master password.
- Follow the site’s rules. If a site rejects symbols, untick them and add four or five characters to make up the difference.
Tips for keeping passwords safe
- Never reuse a password. Store a different one for every account in a password manager.
- Turn on two-factor authentication wherever you can. It protects you even if a password leaks.
- Change a password straight away if the site reports a breach.
- Share a Wi-Fi password with a Wi-Fi QR code instead of reading it aloud.
- Need an ID rather than a secret? Use the UUID generator. To check a download has not been tampered with, compare its checksum with the hash generator.
Want to know why length matters more than symbols, and what NIST now recommends? Read how to create a strong password.
About the word list
The passphrase words come from KazamTools’s own list of 4,096 common English words, written for this tool. Every word is 3 to 9 lowercase letters, with no names, no offensive words and only one spelling of words that sound alike. The idea of building passwords from random words is called Diceware; Arnold Reinhold published it in 1995. The Electronic Frontier Foundation’s 2016 article on its own word lists is a good read if you want to learn more.