Password Generator
Cryptographically random passwords, drawn in the browser, with the entropy printed in bits.
1 to 128 characters.
pool = union of the ticked sets · entropy bits = length × log₂(pool)
Entropy measures the generator, not the account. A 103-bit password is still lost with the database holding it — use a manager, and never the same password twice.
How it works
Set the length and tick the character sets you want. The pool is the union of the ticked sets — 88 symbols with all four on, 62 with symbols off, 10 with only digits.
A password is drawn from that pool with crypto.getRandomValues, the browser’s CSPRNG. Math.random is not used anywhere here: it is fast, seeded, and reproducible, which is the opposite of what a secret needs.
Read the entropy before you use it. Length and pool size are the only two things that move it, and length moves it faster.
Nothing is sent anywhere. The generator is client-side JavaScript, so the password exists in one tab and nowhere else.
Entropy
Entropy counts how many passwords the current settings could have produced, expressed as a power of two — so it is bits, not a score out of five. Sixteen characters from the 26-letter pool is 75 bits; the same sixteen from all 88 symbols is 103. Length is the cheaper lever: one more character on an 88-symbol pool buys 6.5 bits, while switching symbols on adds about half a bit per character.
bits = length × log₂(pool size)
Use cases
A new account
One password per site, generated fresh. Reuse is what turns one site’s breach into every site’s breach, and it is not a discipline problem — nobody remembers fifty distinct passwords, which is why the generator and a manager are one tool used in two steps.
Wi-Fi (WPA2/WPA3) keys
A WPA2 pre-shared key is 8 to 63 ASCII characters. An attacker who captures one handshake can grind it offline at whatever rate their hardware allows, with no lockout to stop them, so the pool matters more here than almost anywhere: 20 random characters is out of reach, a phrase from a wordlist is not.
API keys and dev tokens
For a secret a machine reads and a human never types, take the length to 32 or more and leave every set on. There is nothing to remember, so there is no reason to shorten it. Check what the consuming service accepts first — some reject the shell-hostile symbols.
Passwords a human has to type
Turn symbols off and add length instead. Twenty alphanumeric characters is 119 bits and types cleanly on a phone keyboard, a TV remote, and a console login; twelve characters with symbols is 78 bits and does none of those things well.
PIN-style codes
Digits only, for a door lock or a SIM. Know what you are getting: six digits is 19.9 bits, a million guesses, which is fine behind something that rate-limits and locks out and worthless against anything that can be attacked offline.
Rotating a leaked password
After a breach notice, the replacement has to be a new random string rather than the old one with a digit appended — credential-stuffing lists are mutated with exactly those rules before they are tried.
Questions
- Is it actually random?
- It calls crypto.getRandomValues, the Web Crypto CSPRNG, which browsers seed from the operating system’s entropy pool. That is the same source a password manager uses. Math.random appears nowhere in this tool.
- Does the password leave my browser?
- No. Generation is client-side JavaScript — there is no request, no logging, and nothing stored in the page or on a server. Closing the tab is the whole cleanup.
- How long should a password be?
- Twelve characters across all four sets is about 78 bits, a reasonable floor for an ordinary account sitting behind a rate limit. Sixteen or more — 103 bits — for anything holding money, mail, or other passwords.
- Why does the entropy drop when I untick symbols?
- Entropy is length × log₂(pool), and dropping symbols takes the pool from 88 to 62. That costs about half a bit per character: at sixteen characters, 103 bits becomes 95. Two more characters more than buys it back.
- Is there modulo bias in the draw?
- Technically yes. Values are drawn as 32-bit integers and reduced modulo the pool size, and 2³² is not a multiple of 88, so 48 of the 88 symbols come up more often by roughly one part in 49 million. The entropy cost is a rounding error against the bits you lose by shortening the password one character.
- Do I still need a password manager?
- Yes. A generator solves randomness; it does not solve the fact that you now hold fifty strings nobody can memorise. Paste the output into a manager, not into a notes file.
More tools
One of 18 free tools here. They come out of building utility apps for macOS, iOS and the browser — all of it by one person.
See the apps