Password Generator
Create strong, random, secure passwords with custom rules.
About the Password Generator
The Password Generator creates cryptographically secure random passwords using your browser’s built-in crypto.getRandomValues function. Unlike password generators that rely on Math.random — which is a pseudo-random number generator designed for graphics, not security — this tool pulls entropy from the operating system’s CSPRNG (cryptographically secure pseudo-random number generator), the same source that powers TLS handshakes and session token creation.
NIST Special Publication 800-63B explicitly recommends length over mandatory complexity. The old advice — “must contain uppercase, lowercase, a number, and a symbol” — actually pushes users toward predictable patterns (capitalizing the first letter, appending a digit and an exclamation mark at the end). Length defeats brute-force attacks far more efficiently than character variety: every additional character multiplies the search space by the size of the character set.
Every password generated here stays in your browser. The output is never sent to a server, never logged, never shared with analytics. You can safely generate passwords for banking, email, server root accounts, or cryptocurrency wallets. Pair the generator with a password manager (Bitwarden, 1Password, KeePassXC) so you only need to remember one strong master password.
How It Works
The generator requests len 32-bit unsigned integers from crypto.getRandomValues(), which is the Web Crypto API’s interface to the operating system’s CSPRNG. On Linux this reads from /dev/urandom, on Windows from BCryptGenRandom, on macOS/iOS from the kernel’s ccdrbg. Each call returns values with full 32 bits of entropy per element — not the 53-bit upper limit that Math.random can theoretically provide, and crucially with no measurable statistical bias.
For each character position we take one 32-bit integer modulo the character set size. Simple modulo introduces a tiny bias when 2^32 is not evenly divisible by the set size, but with a 32-bit source the bias is at most charset_length / 2^32 — well below 1 in 4 billion for any practical character set. For a 26-character lowercase alphabet that is roughly 6 × 10^-9 per draw, which is negligible for password-strength purposes.
Entropy is calculated as length × log2(charset_size). A 16-character password using all four character classes (94 printable ASCII characters) yields 16 × log2(94) = 16 × 6.555 = 104.9 bits. That is comfortably above the 80-bit threshold most cryptographers consider “computationally infeasible” to brute-force with current hardware, and within the 128-bit ceiling considered secure against future quantum adversaries.
The strength rating maps entropy into human-readable buckets: 30+ bits is “Weak,” 50+ is “Medium,” 70+ is “Strong,” 100+ is “Very Strong.” The estimated crack time assumes an offline attack against a fast hash (SHA-256, ~10 billion guesses/second on commodity GPUs) — a deliberately conservative baseline because attackers with custom FPGA/ASIC rigs can reach 100 billion guesses per second on weaker hash algorithms like MD5.
Worked Examples
With all four character classes selected and length 16, a typical generated password is K7#mP2$vR8!nQ9&b. It has 16 characters drawn from a 94-character alphabet, giving 16 × log2(94) ≈ 105 bits of entropy — roughly 40 trevigintillion (4 × 10^28) years to brute-force on a single GPU. Even a botnet of 100,000 GPUs would need 4 × 10^23 years, far longer than the age of the universe.
Dropping length to 8 with the same character set produces something like j3$Kp!9N. Entropy falls to 8 × log2(94) ≈ 52 bits, which is crackable in about 7 hours on a single modern GPU. That is the difference between “effectively unbreakable” and “toast in an afternoon.”
For a memorable passphrase-style password, set length to 20 and use only lowercase letters. A result like mgtukrephwnsfjqloiza has only lowercase entropy (20 × log2(26) ≈ 94 bits) — still extremely strong, much easier to type, and free of the special characters that break copy-paste in some terminals and YAML configs. The trade-off is that it is 20 characters long, which some legacy systems reject.
When to Use This Tool
- Generating unique per-site passwords when you adopt a password manager (Bitwarden, 1Password, KeePassXC).
- Creating strong master passwords that protect your entire password vault — use 20+ characters with all character classes.
- Rotating the root password for a database, server, or router on a quarterly schedule.
- Generating API tokens for service-to-service authentication (treat them as long-lived secrets and rotate every 90 days).
- Setting a new Wi-Fi password (WPA2/WPA3) that is resistant to dictionary attacks on captured handshakes.
- Producing one-time encryption passphrases for file-level encryption with VeraCrypt or GPG.
- Demoing password security concepts in security-awareness training or CTF challenges.
Limitations & Disclaimer
This tool generates passwords using the Web Crypto API’s CSPRNG and reports entropy based on character-set size and length. It does not guarantee resistance to phishing, credential stuffing, or server-side breaches — those threats are addressed by password managers and 2FA. Entropy figures assume uniform character distribution and a brute-force attack; targeted dictionary attacks using leaked-password lists (RockYou, Collection #1) can crack low-entropy human-chosen passwords far faster than the estimate suggests. Always test generated passwords against a breach database before adoption. See our disclaimer for full terms.
Frequently Asked Questions
Is this generator safe to use for banking passwords?
Yes. The generator uses <code>crypto.getRandomValues</code>, which is the same CSPRNG used by your browser for TLS session keys. Output never leaves your device, and there is no server-side logging. For an extra layer of security, generate the password, copy it manually into your password manager, and clear your clipboard afterwards.
Why is length more important than special characters?
Each additional character multiplies the search space by the character-set size. Adding one character to a 26-char alphabet multiplies the work by 26; adding a special character (without changing length) only multiplies by 95/94. NIST 800-63B explicitly recommends length over mandatory complexity because complexity pushes users toward predictable patterns like ‘Password1!’.
What is the difference between Math.random and crypto.getRandomValues?
<code>Math.random</code> is a fast PRNG designed for UI animations and is not cryptographically secure — its output can be predicted from past values. <code>crypto.getRandomValues</code> pulls entropy from the operating system (e.g., <code>/dev/urandom</code> on Linux) and is designed for security-sensitive use cases like session tokens and encryption keys.
What entropy level should I aim for?
For most consumer accounts, 70-80 bits is sufficient (12-13 characters with a full charset, or 16 lowercase-only). For high-value targets — cryptocurrency wallets, root accounts, password vault masters — aim for 100+ bits (16+ characters with full charset, or 20+ lowercase).
Are passwords stored or sent anywhere?
No. Everything runs in JavaScript inside your browser. No network request is made, no cookie is set, no analytics event is fired for the generated value. You can verify this by opening your browser’s dev-tools Network tab.
Can a generated password still be weak?
Length alone does not protect you if the password is reused, leaked in a breach, or stored in plaintext by the service. Always pair the generator with a password manager, enable two-factor authentication, and check your email against HaveIBeenPwned to know when a password must be rotated.
Last updated: July 21, 2026 · Author: HT99 Tools Editorial Team · Reviewed by: HT99 Tools Editorial Team