Password Generator
Generate strong random passwords or passphrases — one, or a hundred at a time — using your browser's cryptographic random number generator, with a live entropy calculation. Nothing is transmitted or stored.
Why modulo bias matters
The obvious way to pick a random character is
pool[random % pool.length]. If the random range is not an
exact multiple of the pool size, the first few characters come up
slightly more often than the rest. The bias is small, but it is a free
reduction in strength.
This generator uses rejection sampling instead: draw a random number, discard it if it falls in the uneven tail, and draw again. Every character in the pool then has exactly equal probability.
Reading the entropy number
Entropy is the length multiplied by the base-2 logarithm of the alphabet size, so every row below can be checked by hand.
| Entropy | Verdict | Example |
|---|---|---|
| < 40 bits | Weak | 8 lowercase letters — 37.6 |
| 40–60 bits | Fair | 10 letters and digits — 59.5 |
| 60–90 bits | Strong | 14 letters and digits — 83.4 |
| 90+ bits | Excessive, in a good way | 20 letters and digits — 119.1 |
Adding symbols raises the alphabet from 62 characters to 86, which is worth about half a bit per character — far less than adding characters. This tool's default of 20 characters from all four sets is 128.5 bits.
Crack times assume an offline attack against a fast hash at 100 billion guesses per second. Against a properly configured password hash such as Argon2 or bcrypt the real figures are enormously longer — but you have no way to know which the site uses, so plan for the fast one.
Frequently asked questions
Are these passwords actually random?
They come from crypto.getRandomValues(), the browser's cryptographically secure random number generator, seeded by the operating system's entropy pool. Selection uses rejection sampling rather than a modulo, which would otherwise make some characters marginally more likely than others. Math.random() — used by many generators — is not suitable for this and is never used here.
Is it safe to generate a password on a website?
On this page the generation happens entirely in your browser, nothing is transmitted, and nothing is stored — reload and it is gone. The general caution is still worth keeping: a page you do not trust could send what it generates anywhere. If that matters to you, use your password manager's built-in generator, which is the better habit regardless.
How long should a password be?
Sixteen characters from a mixed alphabet is comfortably beyond brute-force reach today, and 20 or more is sensible for anything protecting money or identity. Length beats complexity: a 20-character lowercase passphrase has more entropy than a 10-character password full of symbols, and you can actually type it.
What does the entropy figure mean?
Bits of entropy measure how many guesses an attacker needs on average — each additional bit doubles that number. Under 50 bits is weak, 60 to 80 is reasonable for ordinary accounts, and above 100 is more than any offline attack will reach. It assumes the attacker knows your exact character set and length, which is the correct pessimistic assumption.
Related tools
- Diagram & Flowchart MakerDraw flowcharts and diagrams, connect the boxes with arrows that route themselves, and let it arrange the whole thing. Exports SVG. Nothing is uploaded.
- HTML Entity EncoderEncode text for HTML or decode entities back — the five markup breakers, named Latin-1 and symbol sets, numeric references up to emoji. Decodes exactly once.
- Regex TesterTest regular expressions with live highlighting, groups and replace preview — JavaScript's own engine, with a kill switch for catastrophic patterns.