Password Generator

A password is only as strong as the process that produced it. Human-chosen passwords cluster heavily around a small number of patterns, which is why cracking tools target patterns rather than the full keyspace. This generator draws every character from the browser cryptographic random source, so the result has the entropy the maths says it does.

How to use it

  1. Choose a length and which character classes to include.
  2. Each character is selected using crypto.getRandomValues.
  3. Copy the password into your password manager. It is never transmitted or stored.

Entropy, in numbers you can act on

Password strength is measured in bits of entropy, calculated as the length multiplied by the base-2 logarithm of the character set size. The number tells you how many guesses an attacker needs on average, and it is the only measure that means anything.

For a full 94-character printable set:

Length beats complexity

Adding a character multiplies the search space by the size of the character set. Adding a character class only increases the base of the logarithm. Going from twelve to sixteen characters adds around 26 bits; adding symbols to a twelve-character alphanumeric password adds around 8.

This is why the composition rules familiar from corporate password policies are counterproductive. Requiring one uppercase, one digit, and one symbol reduces the space of valid passwords rather than expanding it, and it reliably produces the same human workarounds: a capital at the front, a digit and an exclamation mark at the end. Cracking tools model those patterns explicitly.

The NIST digital identity guidelines, SP 800-63B, dropped composition requirements and mandatory rotation for exactly this reason, recommending long passwords checked against known-breached lists instead.

Where the randomness comes from

Every character here is chosen with crypto.getRandomValues, which draws from the operating system cryptographically secure generator. Math.random is not used anywhere, and should never be used for anything security-relevant: it is seeded predictably, and its output stream can be reconstructed from a modest number of observed values.

Character selection also avoids modulo bias. Taking a random byte modulo the character set size makes the earlier characters in the set slightly more likely whenever the set size does not divide 256 evenly. The skew is small but it is a real reduction in entropy, and rejection sampling eliminates it.

When a passphrase is the better answer

Random character strings are ideal for anything a password manager stores and types for you, which should be almost everything. They are impractical for the handful you must actually memorise: your device login, and the master password protecting the manager itself.

For those, a passphrase of random words works better. Six words drawn randomly from a 7,776-word Diceware list gives about 77 bits, comparable to a twelve-character random string, and is dramatically easier to remember and type. The critical word is random: choosing words yourself, or picking a memorable phrase, collapses the entropy to almost nothing.

The generator is not the weak link

Reusing a strong password across sites defeats it entirely, because one breach compromises every account. This is the actual mechanism behind most account takeovers, and no amount of password strength addresses it.

Use a password manager so every account gets a unique password, and turn on multi-factor authentication wherever it is offered. A weak password with a hardware security key is meaningfully safer than a 20-character password without one.

At a glance

Random sourcecrypto.getRandomValues
Character classesLowercase, uppercase, digits, symbols
Modulo biasAvoided by rejection sampling
StorageNone, the password exists only in page memory

Frequently asked questions

How long should my password be?

Sixteen characters from a full set gives around 105 bits, which is beyond brute force by any realistic margin. Twelve is adequate for most accounts. Below twelve, strength depends heavily on how the site hashes it.

Do symbols matter much?

Less than length. Adding four characters typically adds more entropy than adding a whole character class. Some sites also reject symbols or handle them badly, so a longer alphanumeric password is often the more practical choice.

Is the password sent anywhere?

No. Generation happens in your browser, nothing is transmitted, and nothing is stored. Closing the tab discards it, so copy it into your password manager first.

Should I change my passwords regularly?

Only when there is reason to think one is compromised. NIST SP 800-63B dropped scheduled rotation, because forcing frequent changes drives people towards predictable variations of one password.

Read more

Tokens, hashes, and identifiers — Why a UUID is not a secret, a hash is not encryption, and a JWT you have not verified is just a base64 string.

Related tools