Why Use a Password Generator?
Humans are terrible at creating random passwords. We gravitate toward patterns, dictionary words, and personal information โ all of which make passwords easy to crack. A random password generator eliminates human bias, using cryptographically strong randomness to produce passwords that resist brute-force and dictionary attacks.
What Makes a Strong Password?
- Length over complexity: A 16-character lowercase password is harder to crack than an 8-character password with symbols. Length is the single biggest factor.
- Character variety: Mixing uppercase, numbers, and symbols adds entropy. Each additional character set multiplies the possible combinations.
- True randomness: Using
crypto.getRandomValues()โ the same API behind most password managers โ ensures unpredictability. - No patterns: Avoid keyboard walks (qwerty), repeated characters, and sequential numbers.
Recommended Settings by Use Case
| Use Case | Length | Charsets |
|---|---|---|
| General web accounts | 16+ | a-z, A-Z, 0-9, symbols |
| Banking / finance | 20+ | All charsets |
| Wi-Fi passwords | 20+ | All charsets |
| API keys / tokens | 32โ64 | a-z, A-Z, 0-9 (no symbols) |
FAQ
Is the password sent to a server?
No. All generation happens locally using crypto.getRandomValues() in your browser. The password never leaves your device.
How random is it really?
We use the Web Crypto API's CSPRNG (cryptographically secure pseudorandom number generator), seeded by your operating system's entropy source. This is the same API used by major password managers.
Should I use this instead of a password manager?
This tool generates strong passwords, but a password manager also stores, syncs, and auto-fills them. For day-to-day use, combine both: generate here, save in your manager.
Why do some sites reject my password?
Some sites limit special characters or password length. If a generated password is rejected, try disabling symbols or reducing the length. Most sites accept 12โ20 characters with letters and numbers only โ still very strong with our CSPRNG-based generator.
How often should I change my passwords?
Modern guidance (NIST SP 800-63B) says change a password only when you suspect it's compromised โ forced periodic changes just push people toward weaker, easier-to-remember passwords. But when you do rotate one, generate a fresh random password here instead of tweaking the old one.
Should I use a random password or a passphrase?
Both are strong, but they solve different problems. A random string (what this tool generates) is ideal for API keys, tokens, and accounts you'll save in a password manager โ maximum entropy per character. A passphrase (4โ5 random words, think "correct horse battery staple") is better when you must memorize it with no manager, like a disk-encryption key or master password. The rule of thumb: if you can use a manager, go random; if you must type it often or memorize it, a passphrase wins on usability.
How is the strength bar calculated?
It estimates entropy in two dimensions: length and character-set variety. Length dominates โ a 20-character lowercase-only password has roughly 95 bits of entropy, which is more than a 12-character password with all four charsets (~76 bits). The bar uses the same mental model as zxcvbn-style estimators: longer and more varied = exponentially more combinations for an attacker to brute-force.
What about passkeys โ will I still need generated passwords?
Passkeys (WebAuthn) are replacing passwords on more sites every year, and that's a good thing: they're phishing-resistant and can't be leaked from a server breach. But you'll still need strong random passwords for a while โ legacy sites without passkey support, API keys and tokens, and the master password of your password manager all still require one. Generate those here and let passkeys handle the rest.
How do I generate a strong password in code or from the CLI?
Never reach for Math.random() or Python's random module — both are predictable and unfit for secrets. Use a CSPRNG instead. Python: secrets.token_urlsafe(20), or pick your own charset with secrets.choice(). Node: require('crypto').randomBytes(20).toString('base64url') — 20 bytes is 160 bits of entropy in 27 URL-safe characters. Go: crypto/rand with a rejection-sampled charset. CLI: openssl rand -base64 24 or tr -dc 'A-Za-z0-9!@#$%^&*' < /dev/urandom | head -c 24. This page uses the same class of generator in the browser via crypto.getRandomValues(), so its output is statistically equivalent — the difference is only that server-side generation never crosses a clipboard.
What should I do if one of my passwords shows up in a data breach?
Treat it as public and rotate it immediately: generate a fresh random password here, save it in your password manager, and turn on two-factor authentication on that account. Check Have I Been Pwned to see which of your addresses are affected. Never "fix" a breached password by tweaking it (adding a number or a trailing !) โ attackers and cracking tools try those mutations first.
Should every account have a different password?
Yes. Reuse is what turns one breached site into a dozen compromised accounts โ credential stuffing takes the email/password pair from a dump and retries it against every major service within minutes. Generate a unique password per site and let your manager remember them. If you're not ready to migrate everything, at minimum keep email, banking, and cloud accounts on passwords you've never used anywhere else.
My backend uses bcrypt โ do long passwords still help?
Only up to 72 bytes. bcrypt silently ignores everything past byte 72, so a 64-character password is already at the limit and any accented, CJK, or emoji character (2โ4 bytes each in UTF-8) pushes it over. Two different long passwords sharing their first 72 bytes are the same password to the database, and the API never warns you. If you must keep bcrypt, pre-hash with SHA-256 and Base64-encode the digest before passing it in โ Base64 rather than raw bytes, because a NUL byte in a raw digest would truncate it a second time. New projects should use Argon2id or scrypt, which have no length wall. For bcrypt-backed services, a 16โ20 character generated password is the sweet spot: far past the truncation point and still easy to paste.
Why is charset[randomByte() % charset.length] biased?
Because 256 is not a multiple of your alphabet size. With a 62-character alphabet, 256 รท 62 = 4 remainder 8, so the first eight characters can be produced by five byte values while the other 54 can be produced by four โ those eight come up 25% more often. With a 10-character alphabet the remainder is 6, so the skew is worse. The output looks perfectly random to the eye, which is why the bug survives review. The fix is rejection sampling, not a different modulus: draw a byte, discard it if it is โฅ 248 (the largest multiple of 62 below 256), and redraw. crypto.randomInt() in Node, secrets.choice() in Python, and crypto/rand.Int in Go all do exactly this internally. This page uses crypto.getRandomValues() with the same rejection step.