Password Generator
Generate secure random passwords with customizable options. All processing happens in your browser - no data is stored on our servers.
4 - 128 characters
Weak
How the Randomness Actually Works
This generator draws its randomness from window.crypto.getRandomValues() โ the browser's cryptographically secure pseudorandom number generator (CSPRNG) โ rather than Math.random(). That distinction matters: Math.random() is specified for statistical randomness, not unpredictability, and its output has been reverse-engineered in some browser engines to predict future values from past ones. crypto.getRandomValues() is backed by the operating system's secure entropy source and is the right primitive for anything security-sensitive, including passwords.
One small technical nuance worth knowing: each character is picked with randomValue % charSet.length. When the character set's length doesn't evenly divide 2ยณยฒ, this introduces a theoretical modulo bias โ some characters become infinitesimally more likely than others compared to true uniform selection (the mathematically pure approach is rejection sampling, discarding out-of-range values instead of wrapping them with modulo). In practice, for character sets in the tens of characters against a 32-bit random source, this bias is many orders of magnitude smaller than other real-world risks to a password's security โ it's a fact worth knowing if you're evaluating the algorithm, not a reason to distrust the output.
What Actually Determines Brute-Force Resistance
A password's resistance to brute-force guessing is measured in bits of entropy, calculated as length ร logโ(character set size) โ not by how "random-looking" it is to a human eye. With all four character classes enabled here (26 lowercase + 26 uppercase + 10 digits + 26 symbols = 88 possible characters per position), a 16-character password carries roughly 103 bits of entropy (16 ร logโ88 โ 16 ร 6.46). Dropping to a 12-character password with the same character set drops you to about 77 bits โ still strong, but the difference compounds fast because entropy scales with length, not just character variety. Turning off a character class (say, disabling symbols) shrinks the set to 62 characters and costs roughly 1 bit of entropy per position compared to the full 88-character set โ a small-looking change that adds up across a long password.
Why "Exclude Ambiguous Characters" Exists โ and What It Actually Removes
This option strips exactly seven characters from the pool: i l 1 L o 0 O โ the lowercase/uppercase/digit trios that render nearly identically in many fonts (lowercase L vs. digit 1, uppercase O vs. digit 0). It exists for one specific, human problem: when a person has to type a generated password by hand โ reading it off a screen, a printed card, or dictating it over a phone โ these characters cause real transcription errors. It does not improve resistance to automated brute-force guessing at all (a computer doesn't confuse "l" and "1"); it purely trades a small amount of entropy for fewer human typos. If the password will only ever be pasted from a password manager and never hand-typed, there's no security reason to enable it.
The strength meter shown after generation is a simple heuristic โ it awards points for length crossing 8/12/16 thresholds and for each character class present, capped at 100. It is not a true entropy calculation and can rate two passwords of very different actual brute-force resistance as the same "Very Strong" bucket. Use the entropy formula above if you need an actual comparable security number rather than the bar's qualitative label.
Frequently Asked Questions
Does this use a real cryptographically secure random source?
Yes โ it calls crypto.getRandomValues(), the Web Crypto API's CSPRNG, rather than Math.random(). This is the same category of random source recommended for generating session tokens and cryptographic keys, not just a "good enough for UI" generator.
Is a 128-character password meaningfully more secure than a 32-character one?
Beyond roughly 20-25 characters with a full character set (well over 128 bits of entropy), you're already far past what any realistic brute-force attack can crack within the lifetime of the universe using current or foreseeable computing. Extremely long passwords mostly matter for specific protocols or paranoid threat models, not typical account security โ the practical ceiling is much lower than the slider's 128-character maximum.
Should I enable "Exclude Ambiguous Characters"?
Only if you expect to type the password by hand rather than copy-paste it from a password manager. It trades a small, practically insignificant amount of entropy for fewer transcription mistakes โ it has no effect on resistance to automated cracking.
Why does the strength bar say "Very Strong" for two passwords that seem different in quality?
The bar is a threshold-based heuristic (length checkpoints plus character-class presence), not a precise entropy score, so it can bucket passwords of meaningfully different actual entropy into the same label. Trust the length ร character-set-size math over the bar's wording if you need an exact comparison.
Can I reproduce the same password later if I remember the settings?
No, and that's intentional โ every character comes from a fresh call to the CSPRNG with no seed you control, so the same length and character-type settings will never regenerate the same password twice. If you need to retrieve a password later, save it in a password manager rather than trying to recreate it.
