How to use the generator
- Choose Password for a random string of characters, Passphrase for a few random words, or PIN for digits only.
- Adjust the length or number of words. The strength meter updates as you go.
- Press Copy and paste the result where you need it. Generate another gives you a fresh one.
For passwords you’ll read off a screen or type on a TV remote, switch on Avoid look-alike characters. This drops I, l, 1, O, 0 and o, so you won’t confuse one for another.
How the passwords are generated
Every character comes from crypto.getRandomValues, the browser’s cryptographically secure random number generator. Math.random is never used. It is designed to be fast, not unpredictable, and its output can be reconstructed from a handful of samples.
Turning a random 32-bit number into a character has a subtle trap. The obvious approach, number % alphabetSize, is slightly biased: 2³² is not a multiple of 88, so the first few characters of the alphabet come up a little more often than the rest. This generator uses rejection sampling instead. Any draw that falls in the uneven final block is thrown away and redrawn, so every character is exactly equally likely. The code is covered by statistical tests that check the output distribution and confirm the check fails for a biased generator.
When several character types are selected, the generator guarantees at least one of each. It does this by discarding whole passwords that miss a type and drawing again, rather than swapping a character in afterwards. That keeps every valid password equally likely.
What “bits of entropy” means
Entropy measures how many equally likely passwords the generator could have produced. Each extra bit doubles the number. A password with 60 bits of entropy is one of 2⁶⁰ (about a quintillion) possibilities, and an attacker has to try half of them on average.
The figure shown here is exact for this generator: it counts every possible output given your settings, including the at-least-one-of-each rule. As a rough guide:
| Entropy | What it resists |
|---|---|
| Under 50 bits | Online guessing, but not an offline attack on a leaked hash |
| 50–70 bits | Most offline attacks on slow, well-salted hashes |
| 70–100 bits | Well-funded offline attacks on fast hashes |
| 100+ bits | Brute force by any foreseeable computer |
The time shown under the meter assumes an attacker making a trillion guesses per second, a realistic figure for a rig of GPUs attacking a fast, unsalted hash. Against a site that stores passwords properly, real attacks are millions of times slower.
Passwords or passphrases?
| Random password | Passphrase | |
|---|---|---|
| Example | t7]Vq$wE2n!xK9@pLz#d |
banjo-dwelling-unsaid-ripcord-gusty-thaw |
| Entropy | ~129 bits (20 characters) | ~78 bits (6 words) |
| Easy to type on a phone | No | Yes |
| Easy to remember | No | Reasonably |
| Best for | Anything stored in a password manager | Your master password, device logins, Wi-Fi |
Passphrases use the EFF long word list: 7,776 common, distinct English words chosen by the Electronic Frontier Foundation to be easy to type and hard to mistake for one another. Each word adds about 12.9 bits. Capitalising words adds nothing, because the attacker knows the rule. Adding a number in a random word adds about 6 bits.
Random PINs
A PIN is short by design: a 6-digit PIN has only a million possibilities, about 20 bits. That’s fine where wrong guesses are limited, such as a bank card that locks after three tries or a phone that slows down after a few. It is not fine for anything an attacker can guess offline, so never use a PIN as a password.
What really weakens a PIN is people’s habits. Studies of leaked PINs found that 1234, 1111 and 0000 alone made up nearly a fifth of all 4-digit PINs, with birth years and keypad patterns such as 2580 close behind. With Avoid common PINs on, the generator skips repeated digits, straight runs like 1234 or 9876, years from 1900 to 2099 and the most common published PINs. It redraws instead of tweaking, so every remaining PIN is equally likely, and the count shown is exact.
Privacy
This page has no analytics, no cookies and no server-side code. The generator never sends anything over the network; the only file it fetches is the word list, and only when you switch to passphrase mode. The page’s Content Security Policy blocks scripts from any other domain.
The EFF word list is © Electronic Frontier Foundation and used under the Creative Commons Attribution 3.0 US licence.