Password Generator
This password generator creates random passwords with a length from 8 to 64 characters using your selected character groups. It uses crypto.getRandomValues and estimates entropy as length multiplied by the base-2 logarithm of the available character-pool size.
By Dr. Hassan Khames EliwaLast updated
How it works
Build the pool before choosing the length
Uppercase letters, lowercase letters, digits and symbols determine which characters can be selected. With all four groups enabled and look-alike exclusions disabled, the standard printable ASCII pool contains 26 uppercase letters, 26 lowercase letters, 10 digits and 32 symbols: 94 characters in total. Spaces are not part of that pool.
Turning a group off reduces the pool. Excluding look-alikes removes the characters identified by the generator’s exclusion rule, which can help when a password must be read aloud or copied by hand. Use the resulting pool size shown by the tool, not the original 94, when interpreting the entropy estimate. There must be at least one enabled group with available characters.
Randomness and entropy
The generator uses the browser’s cryptographic random source, crypto.getRandomValues, rather than Math.random. For a uniform independent selection at each position, a pool of P characters and a length of L produce P raised to L possible strings. Taking the base-2 logarithm expresses that search space in bits.
This formula assumes each character is chosen independently and uniformly. It describes the random generation process, not a password’s appearance. A person typing a familiar phrase with predictable substitutions does not obtain the same entropy simply because the phrase is long and contains several character classes.
Mapping random bytes to pool indexes also needs care: taking a byte modulo the pool size can favor some characters when the size does not divide 256. A correct implementation avoids that bias, for example by rejecting out-of-range random values before mapping them. The entropy model presumes that uniform selection is actually achieved.
What the number does not promise
Entropy bits are not a guaranteed time to crack. An attacker’s options depend on whether guesses are rate-limited online or attempted against stolen password hashes, how those hashes are protected and whether the password has already been exposed. Phishing and malware can bypass a large guessing space entirely.
Enabling a character group makes its characters available for selection. It does not by itself establish that every output includes at least one character from each group. If a site requires particular classes, check the generated result against that site’s rules rather than assuming a pool setting is a composition guarantee.
Use a password manager to store generated passwords and create a different password for every account. Multi-factor authentication or a passkey provides protection that a larger character pool alone cannot supply.
Worked example
Sixteen characters from the full pool
Choose a length of 16, enable uppercase, lowercase, digits and symbols, and leave look-alike exclusions off. The available pool is 94 characters.
The estimate is 16 × log2(94) = 104.8734216268422 bits, or approximately 104.9 bits. The possible-string count is 94 raised to the sixteenth power. No particular sample password is required to obtain this estimate: every independently and uniformly generated 16-character string from that pool has the same generation-space calculation.
If you disable symbols, the pool becomes 62 characters, and the same length yields about 95.3 bits. Increasing length can compensate for a smaller pool, which is useful when a service restricts symbols. Neither number justifies reusing the result across accounts; reuse creates an exposure path unrelated to guessing strength.
Expert tips
Common mistakes
- Editing the random result into a familiar pattern. Replacing a segment with a name or date changes the random-generation assumptions behind the entropy display.
- Treating all symbols as universally accepted. Sites vary in their validation rules. Check the actual password field and keep the final saved credential consistent with what was accepted.
- Thinking a high bit count prevents phishing. A convincing fake login page can capture a strong password. Verify the destination and use phishing-resistant authentication where available.
Frequently asked questions
What lengths are available?
The generator supports 8 through 64 characters. Use a length compatible with the target service and prefer longer random passwords when practical.
Does excluding look-alikes change entropy?
Yes. Removing characters reduces the pool size. The displayed estimate should use the remaining available pool, so it decreases at a fixed length.
Is the same password produced every time?
No. Each generation draws fresh cryptographic randomness. A repeated output is mathematically possible, but the tool is not intended to reproduce a password from a seed.
Does selecting all groups guarantee one of each?
Pool selection alone does not guarantee representation in every generated string. Check any site-specific composition requirement against the resulting password.
Are entropy bits a crack-time estimate?
No. They describe the theoretical random search space under uniform independent selection. Actual attack speed, rate limits, password hashing and compromise paths are separate issues.
Should I reuse a generated password?
No. Use a unique password for each account. A breach at one service should not provide the credential for another account.
Related calculators
Related guides
Sources and standards
About the author
Dr. Hassan Khames Eliwa holds a PhD in Construction & Built Environment and has more than 20 years of international project controls experience. He is Director of Eliwa Project Controls Limited in Auckland and founder of PMMilestone.org and PMMilestone.com.
Buy me a coffee