Password Generator
Random passwords from your browser’s cryptographic random source, with a real entropy figure.
Strength: Very strong
How it works
The strength of a random password is not how odd it looks; it is how many possibilities an attacker has to try. That number is its entropy, measured in bits, and each extra bit doubles the work. Twelve characters drawn from the 62 letters and digits is about 71 bits; sixteen characters with symbols as well is about 105.
Every character here comes from `crypto.getRandomValues`, never `Math.random`. `Math.random` is a pseudo-random generator seeded from the clock: the output looks fine, and anyone who knows roughly when the password was generated can narrow the search to something feasible. That is the whole attack.
Picking a character is also not simply `random % alphabetSize`. That is biased: when 256 is not a multiple of the alphabet size, the earlier characters come up more often. This tool discards bytes that fall outside the largest exact multiple and draws again, so every character is equally likely.
The crack-time figure assumes 100 billion guesses per second — a well-funded attacker against a leaked database hashed with a fast algorithm. It is deliberately pessimistic: an estimate that flatters the password is worse than none.
Formula
entropy in bits = length × log₂(alphabet size)
This holds only for randomly generated passwords. One a person invented always has far less real entropy than the formula suggests, because people choose in patterns.
Worked example
Sixteen characters using all four sets:
- Alphabet size
- 26 + 26 + 10 + 24 = 86 characters
- Entropy per character
- log₂(86) ≈ 6.43 bits
- Total entropy
- 16 × 6.43 ≈ 103 bits
- Guesses needed (half the space, on average)
- 2¹⁰² ≈ 5 × 10³⁰
- At 100 billion guesses per second
- about 1.6 × 10¹² years
One more character is worth more than one more character set: each added character multiplies the space by 86, while turning symbols on only takes the alphabet from 62 to 86.
Frequently asked questions
How long should a password be?
For anything that matters, 16 characters or more with all four sets is comfortably safe for decades. Below 12, do not use it for anything of value.
Length or complexity?
Length. Each added character multiplies the search space by the whole alphabet size, while adding a character set only widens the alphabet a little. Twenty lowercase letters beat ten mixed-case-with-symbols.
Is the password sent anywhere?
No. It is generated on your device and exists only in the page’s memory. Reload and it is gone — nothing is written to storage or sent to a server.
Does avoiding look-alike characters weaken it?
Slightly: a smaller alphabet means less entropy per character. The figure shown already accounts for the real alphabet, so adding two or three characters more than makes up for it. Worth it whenever the password has to be read off a screen and typed somewhere else.
Where should I keep it?
In a password manager. A password strong enough to be worth generating is one nobody can remember, and that is a feature rather than a problem — as long as you are not the one remembering it. Not in an unencrypted note, and not over chat.
Can I trust the crack-time estimate?
It is an upper bound that assumes the service storing your password hashes it properly. If that service is breached and hashed badly, or if your password appears in a breach corpus, the number means nothing. It measures the password, not where you send it.