# Password Generator

> Draws a password from the browser's cryptographic random number generator, one character at a time, and reports the entropy of the generator that produced it rather than a guess at the strength of the string. The password is never written to the address bar, never stored and never sent anywhere.

Use it: https://tessalor.com/en/generators/password-generator

This tool runs entirely in the browser. Nothing entered into it is uploaded.

## How it is done

1. Build the alphabet by joining the character classes that are switched on - 26 lower-case letters, 26 upper-case, 10 digits, and 28 ASCII punctuation marks with the two quote characters, the backtick and the backslash left out.
2. If look-alike characters are excluded, remove capital i, lower-case L, one, the pipe, zero and capital O from that alphabet before anything else happens.
3. Work out the rejection limit - the largest whole multiple of the alphabet size that is not greater than 256. For an alphabet of 90 that limit is 180.
4. Draw one byte from crypto.getRandomValues. Discard it if it is at or above the limit, because folding it in with a remainder would make the first few characters of the alphabet more likely than the rest. Otherwise take the character at that byte's remainder.
5. Repeat until the candidate is the requested length.
6. If at least one of every kind is required and the candidate is missing a kind, throw the whole candidate away and draw a fresh one. Do not repair it by substituting a character, because that produces a distribution nobody can state the entropy of.
7. Count the passwords the settings can produce, by inclusion and exclusion over the classes, and report the base-2 logarithm of that count as the entropy in bits.

## Assumptions

- The entropy figure describes the generator, not the string. A run of 20 lower-case letters is exactly as strong as any other draw of the same settings, because an attacker has no way of knowing it came out that way.
- Requiring at least one of every kind reduces the number of passwords the generator can produce, so it reduces entropy. This tool reports the reduced figure; most generators report the larger one.
- The time to guess assumes 100 billion guesses a second, which is an offline attack with commodity graphics hardware against a fast, unsalted hash. A password stored with bcrypt or Argon2 is many orders of magnitude slower to attack, and a rate-limited login is slower again.
- The time shown is the average, not the worst case - half the search space, or two to the power of one less than the entropy.
- Two quote characters, the backtick and the backslash are left out of the symbol set because they break when a password is pasted into a shell command or a JSON file. That costs about 0.06 bits per character.
- Entropy says nothing about reuse, phishing or a breach at the other end. A perfect password used in two places is one password.

## Inputs

| Name | Label | Type | Default | Range |
| --- | --- | --- | --- | --- |
| `length` | How long | select | 20 |  |
| `lowercase` | Lower-case letters | toggle | true |  |
| `uppercase` | Upper-case letters | toggle | true |  |
| `digits` | Digits | toggle | true |  |
| `symbols` | Symbols | toggle | true |  |
| `avoidAmbiguous` | Leave out look-alike characters | toggle | false |  |
| `requireEach` | At least one of every kind selected | toggle | true |  |

## Outputs

- `password` — Your password (text), primary
- `entropyBits` — Entropy, in bits (number)
- `alphabetSize` — Characters to choose from (integer)
- `crackTime` — Average time to guess (text)

## Questions

### Is the password sent anywhere, or stored?

No. It is generated by your browser and exists only in the page in front of you. There is no server to send it to - the whole site is static files. The settings travel in the address bar so a link reproduces the same options, but the password itself is deliberately kept out of it, so copying the link shares the recipe and not the secret.

### Why is the entropy lower here than on other password sites?

Because "at least one of every kind" is switched on, and that rule shrinks the set of passwords the generator can produce. At 20 characters it rules out roughly one string in ten, which costs 0.15 bits. Most generators impose the rule and then report the figure for an unconstrained draw, which is slightly too high. Switch the rule off and the two figures agree.

### Is eight characters enough?

No. Eight characters drawn from all 90 gives 50.9 bits, which is about three hours of guessing at 100 billion attempts a second. Twelve characters is 77.4 bits and around 32,000 years at the same rate; sixteen is 103.6 bits. Length is the only setting that changes the answer by orders of magnitude.

### Does this use Math.random?

Never. Every byte comes from crypto.getRandomValues, which is the platform's cryptographic generator. Math.random is a fast non-cryptographic algorithm with a small internal state that can be recovered from a handful of its own outputs, so a password built from it can be reproduced by anyone who sees another one. There is a test in this tool's test file that fails if Math.random is ever called.

### Should I turn on "leave out look-alike characters"?

Only for a password a person has to read and retype - a wi-fi passphrase on a router label, a temporary password read down a phone line. It removes I, l, 1, the pipe, 0 and O, which shrinks the alphabet from 90 to 84 and costs about 0.1 bits per character. For anything going straight into a password manager it is a pointless loss.

### How long should a password actually be?

Long enough that the entropy is past 80 bits for an account that matters, which is 13 characters on these settings, and past 128 bits for a master password or an encryption key, which is 20. Both thresholds are asserted in this tool's test file. Beyond that the password stops being the weakest part of the system by a wide margin.

## Sources

- [RFC 4086: Randomness Requirements for Security](https://www.rfc-editor.org/info/rfc4086/) — IETF, applies to 2005. Retrieved 2026-07-30.
- [NIST SP 800-63B-4: Digital Identity Guidelines, Authentication and Authenticator Management](https://pages.nist.gov/800-63-4/sp800-63b.html) — National Institute of Standards and Technology, applies to revision 4, August 2025; it supersedes the 2017 revision most password advice still quotes. Retrieved 2026-07-30.
- [Web Cryptography Level 2](https://www.w3.org/TR/webcrypto/) — World Wide Web Consortium, applies to 2025. Retrieved 2026-07-30.

## Variants

- [How do I make a strong password with no special characters?](https://tessalor.com/en/generators/password-generator/no-special-characters)
- [What should I use as a wi-fi password?](https://tessalor.com/en/generators/password-generator/for-wifi)

---

Estimate, not advice. See https://tessalor.com/en/disclaimer.
Machine-readable catalogue: https://tessalor.com/api/tools.json
