Free tool
Password generator: strong, random passwords
Get a strong random password, a passphrase or a PIN right away. Pick the length and characters, see the entropy in bits and how long it would take to guess, and make up to 100 at once. Everything happens in your browser.
Free · no sign-up · runs in your browser, nothing is uploaded
…
Entropy
128.7 bits
Very strong
Character pool
87
20 characters
Average time to guess it, if the attacker knows these settings:
| Online, rate-limited1e2 guesses/s (assumed) | 8.9e28 years |
| Offline, slow hash (bcrypt-like)1e5 guesses/s (assumed) | 8.9e25 years |
| Offline, fast hash on GPUs1e11 guesses/s (assumed) | 8.9e19 years |
For scale, the universe is about 1.4e10 years (13.8 billion) old.
Made with crypto.getRandomValues and rejection sampling, in this tab. Nothing is sent, stored or put in the URL.
How long should a password be?
NIST SP 800-63B, the US federal guide to passwords, sets the minimum at 15 characters when a password is the only factor, and 8 when it is used with a second factor. It also says sites should accept at least 64 characters and should not force rules like "one uppercase, one symbol". Length matters more than variety.
Entropy is length × log2(pool size). Here is what common settings give:
| Length | Digits (10) | Letters + digits (62) | All printable ASCII (94) |
|---|---|---|---|
| 8 | 26.6 bits | 47.6 bits | 52.4 bits |
| 12 | 39.9 bits | 71.5 bits | 78.7 bits |
| 15 | 49.8 bits | 89.3 bits | 98.3 bits |
| 16 | 53.2 bits | 95.3 bits | 104.9 bits |
| 20 | 66.4 bits | 119.1 bits | 131.1 bits |
| 32 | 106.3 bits | 190.5 bits | 209.7 bits |
The default here is 20 characters from upper and lower case, digits and 25 symbols (87 characters), which is about 129 bits. With "Require at least one from every set" on, the tool counts only the passwords that pass that rule, so the number shown is exact and a little lower.
Password, passphrase or PIN?
A random password is the best choice for anything a password manager fills in. A passphrase is a few random words, like a sentence nobody would write. It is easier to type on a phone or TV and to remember, so it suits the few passwords you type by hand.
The word list here has about 1,040 short, common English words, so each word adds about 10 bits. Six words give about 60 bits, plus about 6 more for a digit in a random position. Choose 8 words or more for a master password. The EFF large word list has 7,776 words (about 12.9 bits each), which is why EFF dice phrases can be shorter for the same strength.
A PIN is digits only and weak on its own: 6 digits is under 20 bits. It is fine where the device locks you out after a few wrong tries, like a phone or a bank card, and nowhere else.
How this password generator works
Every character comes from crypto.getRandomValues(), the browser's cryptographically secure random number generator. It is not Math.random(), which is fast but predictable and must never be used for passwords.
Picking a character from random numbers has a trap called modulo bias. A random byte has 256 values. If you take byte % 87, the first 82 characters can come up 3 ways and the other 5 only 2 ways, so some characters show up more often. This tool draws 32-bit numbers and throws away the few at the top that do not divide evenly (rejection sampling), so every character is exactly as likely as any other.
"Require every set" works by drawing the whole password again until it contains each set, instead of forcing one character from each set into fixed places. That keeps every allowed password equally likely. The crack-time table assumes the attacker knows your settings and has to try half the possible passwords on average.
Generate a password in code or a terminal
Use the secure random source of your language, never a general-purpose one like random in Python or Math.random in JavaScript.
# Python 3 (secrets is the module for passwords and tokens)
import secrets, string
alphabet = string.ascii_letters + string.digits + string.punctuation
password = ''.join(secrets.choice(alphabet) for _ in range(20))
// Node.js (crypto.randomInt is uniform, no modulo bias)
const { randomInt } = require('node:crypto');
const a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*';
const password = Array.from({ length: 20 }, () => a[randomInt(a.length)]).join('');
// Go (crypto/rand.Int returns a uniform value in [0, max))
const a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
b := make([]byte, 20)
for i := range b {
n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(a))))
b[i] = a[n.Int64()]
}
# Shell: tr drops bytes outside the set, so the result is unbiased
LC_ALL=C tr -dc 'A-Za-z0-9!@#%^*_+=-' < /dev/urandom | head -c 20; echoTo store passwords on a server, hash them with a slow password hash such as bcrypt, never as plain text. The bcrypt generator makes and checks bcrypt hashes, and the htpasswd generator makes Apache and Nginx password files. For API keys and tokens instead of passwords, use the random string generator.
Tips that matter more than the generator
- Use a different password for every account. A leak on one site is then only one leak.
- Save passwords in a password manager right away. Copying from this page puts the password on your clipboard; paste it, then copy something else.
- Turn on two-factor login where you can. Even a perfect password can be phished.
- Turn on "Avoid look-alikes" for passwords you will read aloud or type from paper, so
l,1andIare never mixed up. - Do not reuse a generated password after it has appeared in a screenshot, a chat or a ticket.
Looking for a password manager or other security products? Browse security tools on DevHunt.
More free developer tools
Looking for a full product instead? See security tools on DevHunt.
FAQ
Is it safe to use an online password generator?+
It is safe when the password is made on your device and never sent anywhere. This one runs in your browser tab with crypto.getRandomValues, the same random source browsers use for encryption keys. Nothing is uploaded, stored or put in the URL. You can load the page, go offline and it still works.
How long should a password be?+
At least 15 characters if the password is the only thing protecting the account, which is the minimum in NIST SP 800-63B (revision 4). With two-factor login, NIST allows 8. Since a password manager types it for you, 20 random characters is an easy default and gives about 129 bits of entropy.
What makes a password strong?+
Being random and long. Strength comes from how many passwords the generator could have made, measured in bits of entropy. A 16-character password from about 90 characters has over 100 bits. A long password built from a word, a year and a symbol is weak, because attackers try those patterns first.
Is a passphrase better than a password?+
It is easier to remember and type, but needs more length for the same strength. Each word from this list adds about 10 bits, so six words give about 60 bits and eight words about 80. A random password reaches 80 bits in 13 characters. Use a passphrase for things you type by hand, like a laptop login or the master password of a password manager.
How long would it take to crack my password?+
It depends on how the site stores it and how fast the attacker can guess. The table in the tool shows the average time at three guess rates, from a rate-limited login form to GPUs against a fast hash. The rates are assumptions, not measurements. Above about 80 bits, every row is far beyond any real attack.
Should I change my passwords regularly?+
No, not on a schedule. NIST SP 800-63B says verifiers shall not require periodic password changes, and should force a change only when there is evidence the password was compromised. Change it after a breach, and use a different password for every site so one leak does not open the others.
Why does a site reject my generated password?+
Some sites limit the length or the symbols they accept. Lower the length, turn on "Avoid look-alikes", or edit the "Symbols to use" box to only the symbols the site allows. Keep the length up when you remove symbols: 20 letters and digits still give about 119 bits.
Sources: NIST SP 800-63B rev. 4 · MDN: crypto.getRandomValues() · Python secrets · Go crypto/rand · Node.js crypto.randomInt · EFF dice-generated passphrases. Checked 2026-10-31.