Free Password Generator — Secure Random Passwords
Generate strong, random passwords instantly. 100% client-side — your passwords are never sent to any server.
103.4 bits
88 possible characters, 16 long. Each extra character adds 6.5 bits.
crypto.getRandomValues). Nothing is transmitted, logged or stored.Related Calculators
What is Password Strength and Generation?
A password's strength is not a feeling, and it is not the number of symbols in it. It is a measurable quantity called entropy, and you can compute it exactly: how many characters could appear in each position, raised to the number of positions.
Entropy is measured in bits, where each bit doubles the number of guesses an attacker needs. A password with 40 bits of entropy takes about a trillion guesses to exhaust; one with 80 bits takes about a trillion trillion. That is the whole of password security in one number.
The reason this framing matters is that it contradicts most of the advice people have absorbed. Substituting @ for a and adding a 1 at the end adds almost nothing, because attackers apply exactly those substitutions first. Adding four more random characters adds far more than any amount of cleverness.
The formula — how to calculate Password Strength and Generation
- Pool size
- = how many distinct characters can appear in each position
- Length
- = how many positions there are
- log₂(pool)
- = bits contributed by each character: 4.7 for lowercase alone, 6.4 for all four classes
This formula only holds if each character is chosen independently and uniformly at random. A password a human invented has far less entropy than its length and character set suggest, because human choices are not uniform.
Step-by-step example
- 01A 16-character password drawing on lowercase, uppercase, digits and 26 symbols has a pool of 88 characters.
- 02Bits per character: log₂(88) = 6.46.
- 03Total entropy: 6.46 × 16 = 103.4 bits.
- 04Guesses required to exhaust the space: about 2¹⁰³, or 10³¹.
- 05At a trillion guesses a second — a realistic rate for offline cracking of a weak hash — that is about 3 × 10¹¹ years. The universe is 1.4 × 10¹⁰ years old.
- 06Now compare "P@ssw0rd123!". Twelve characters, all four classes, so naively 77 bits. Its real entropy is close to zero, because it is a dictionary word with the standard substitutions applied and a predictable suffix. A cracking tool tries it in the first few thousand guesses. Length and character classes describe the password; they do not describe how it was chosen.
What the entropy numbers mean in practice
Entropy thresholds
| Bits | Search space | Verdict |
|---|---|---|
| < 40 | Under a trillion | Broken. Cracked in seconds offline. |
| 40–59 | Up to 10¹⁸ | Weak. Hours to days against a serious attacker. |
| 60–79 | Up to 10²⁴ | Adequate for low-value accounts with rate limiting. |
| 80–127 | Up to 10³⁸ | Strong. Beyond brute force with current hardware. |
| 128+ | Over 10³⁸ | Excessive for a password, and harmless. |
These assume the attacker has stolen the password database and is guessing offline against the hash. Against a live login form with rate limiting, far less entropy suffices — but you cannot rely on a site's rate limiting, because breaches are exactly when it stops applying.
Length beats complexity, and it is not close
Adding one character to a 4-class password adds 6.5 bits. Adding an entire character class to a 16-character lowercase password adds 16 bits total. Two more characters beat the whole uppercase alphabet. This is why modern guidance from NIST dropped mandatory complexity rules and raised the minimum length instead.
Why the random number generator matters
Entropy assumes the characters were chosen unpredictably. If the generator itself is predictable, the entropy figure is fiction no matter how long the password is.
Ordinary JavaScript randomness — `Math.random()` — is not suitable. It is a fast pseudo-random generator designed for simulations and games. Its internal state is small, its seed is not secret, and researchers have demonstrated recovering that state from a short run of outputs and then predicting every subsequent value. A password generator built on it produces passwords that look random and are reconstructable by anyone who sees a few of them.
The correct source is the platform's cryptographic generator, exposed in browsers as `crypto.getRandomValues`. It draws from the operating system's entropy pool, which is seeded from hardware sources, and it is designed so that observing past output tells you nothing about future output. This page uses it.
There is a subtler flaw even with a good generator: taking a random number modulo the pool size biases the result. If the pool has 88 characters and the random source produces values from a range that is not a multiple of 88, the first few characters come up slightly more often. The fix is rejection sampling — discard values in the uneven tail and draw again — which is what happens here.
Passphrases as the alternative
For the passwords you have to type from memory, random character strings are the wrong tool. Four or five random words are easier to remember and can carry comparable entropy.
The arithmetic: choosing uniformly from a 7,776-word list gives log₂(7776) = 12.9 bits per word. Four words is 51.7 bits, five is 64.6, six is 77.5. So a six-word passphrase is roughly equivalent to a 12-character random password, and far easier to type on a phone.
The conditions are strict. The words must be chosen randomly — by dice or by software, not by you — and the list size must be known. A phrase you composed yourself carries a fraction of the entropy, because human word choice follows grammar and association.
"correct horse battery staple", from the well-known comic, is now in every cracking dictionary. That does not invalidate the method; it illustrates that a published example is no longer random.
- Diceware —
- the original method: roll five dice per word to index a 7,776-word list. Physically random, verifiable, and independent of any software you have to trust.
- Where passphrases fit —
- the handful you must memorise — your password manager's master password, your device login, your email. Everything else should be a long random string you never see.
The practical system
The strongest password is worth little if it is reused, and reuse is the single largest cause of account compromise. When one site is breached, attackers replay the credentials everywhere else — credential stuffing — and it works because most people reuse.
The workable arrangement is a password manager holding a unique 16-to-20-character random password for every account, protected by one long passphrase you memorise, with two-factor authentication on the accounts that matter.
Two-factor is worth more than any password improvement. A stolen password alone does not get an attacker in. App-based codes or a hardware key are meaningfully better than SMS, which is vulnerable to SIM swapping — though SMS two-factor still beats none.
Current NIST guidance also reversed two long-standing rules: it recommends against forced periodic password changes, which push people toward predictable increments, and against composition rules that mandate particular character types. Change a password when there is reason to think it is exposed, not on a schedule.
Check whether yours is already public
Billions of credentials from past breaches are in circulation. Have I Been Pwned lets you check an address against them without handing over anything sensitive. If a password of yours appears, its entropy is irrelevant — it is already on a list, and every account still using it should be changed now.
Common mistakes to avoid
- Reusing a password across sites. One breach then compromises all of them.
- Judging strength by character classes rather than by how the password was chosen.
- Substituting @ for a and 0 for o. Cracking tools apply those rules first.
- Building a password from personal facts — names, birthdays, pets — which are public.
- Trusting a generator built on ordinary pseudo-randomness rather than a cryptographic source.
- Changing passwords on a schedule, which produces predictable increments.
- Relying on SMS two-factor for a high-value account when an app or key is available.
Frequently asked questions
Sources & references
Written and fact-checked by the CalcProLabs Editorial Team. Read our calculation methodology and editorial policy.
Last updated