Password Generator
Generate random passwords using the browser’s cryptographic random number generator, with live entropy measurement.
Runs entirely in your browser. Your input is never sent to our servers.
What is Password?
Password entropy is the number of bits of randomness in a password, calculated as the length multiplied by the base-2 logarithm of the alphabet size, and it is the only meaningful measure of resistance to guessing.
What this Password Generator does
Generates random passwords using crypto.getRandomValues(), the browser’s cryptographically secure random number generator, and reports the resulting entropy in bits alongside an estimated offline cracking time.
Character selection uses rejection sampling rather than the modulo operator. Taking a random byte modulo the alphabet size biases the result toward the start of the alphabet whenever 256 is not an exact multiple of that size. Rejection sampling discards out-of-range bytes instead, keeping the distribution uniform.
How to use it
- Set the length. Longer contributes more entropy than a wider alphabet.
- Choose character sets. Disable look-alike characters if the password will be read aloud or typed from paper.
- Copy the result, or press Regenerate for another.
Understanding your results
Entropy in bits — each additional bit doubles the search space. Around 60 bits is adequate for accounts protected by rate limiting; 90 or more is appropriate for anything whose hash could be stolen and attacked offline.
Offline attack estimate — assumes 1012 guesses per second against a fast hash, and halves the search space on the reasoning that an average attack succeeds midway through. This is deliberately pessimistic. A password stored with bcrypt or Argon2 resists attack far longer; one stored as unsalted MD5 falls far faster.
Why this matters
Human-chosen passwords cluster heavily. People pick words, names, dates and predictable substitutions, and attackers model exactly those patterns. A password that looks complex to a person — P@ssw0rd! — has very little entropy, because it is a common word under a transformation every cracking rule set already applies.
Random generation removes the human from the choice, which is the entire point. It also makes the strength calculable: with a known alphabet and a known length, the entropy is exact rather than estimated.
Worked examples
20 characters, all four sets — an 88-character alphabet gives about 6.46 bits per character, so roughly 129 bits total. That is beyond brute force by any foreseeable means.
8 characters, lowercase only — a 26-character alphabet gives 4.7 bits per character, about 37 bits. That falls in seconds against a fast offline attack.
Length versus complexity — 16 lowercase characters (75 bits) beats 10 characters from all four sets (65 bits). Length is usually the cheaper win.
Common mistakes
Reusing a strong password. Entropy is irrelevant once a password appears in a breach corpus. Uniqueness per site matters more than strength.
Trusting strength meters. Most score character-class variety, not entropy, and rate Password1! highly while it is trivially guessed.
Composition rules that reduce entropy. Forcing exactly one symbol in a fixed position narrows the search space rather than widening it.
Relying on a password alone. Multi-factor authentication defeats credential stuffing regardless of password strength.
Technical background
Math.random() is unsuitable for anything security-related: it is seeded from predictable state and its output can be reconstructed from a handful of samples.crypto.getRandomValues() draws from the operating system’s CSPRNG. The difference is not academic — password generators built on Math.random() have produced predictable output in the field.
Limitations
The cracking estimate is a scenario, not a prediction. Real cost depends on the hash algorithm, its work factor, and the attacker’s hardware.
Entropy assumes the password is genuinely random. It says nothing about a password you chose yourself — for those, the calculation overstates strength substantially.
Frequently asked questions
Is the password sent to your server?
No. It is generated in your browser and never transmitted, logged or stored. Reloading the page discards it.
How long should a password be?
For anything important, aim for at least 16 random characters, which gives roughly 90+ bits with a mixed alphabet. Below about 60 bits, offline attacks become practical.
Is length or complexity more important?
Length. Each character multiplies the search space by the alphabet size, so adding characters raises entropy faster than adding character classes to a short password.
Why avoid look-alike characters?
It slightly reduces entropy but prevents transcription errors when a password is read aloud or copied from print. For passwords that live only in a manager, leave them enabled.
Should I use this or a password manager?
Use a password manager. It generates, stores and fills unique passwords per site. This tool is useful when you need a value outside that workflow — an API key, a service account, a seed.
References
Last reviewed