toooly-box

Password Generator

Generate a strong random password, with the character sets you choose and the entropy spelled out.

runs locally
Password generator
How many
bits of entropy129
Very strong●●●●
Offline guessing timelonger than the universe has existed

Generated here, in your browser. Never sent anywhere, never stored.

What makes a password strong?

Length, and being unpredictable. Strength is measured in bits of entropy: the size of the character set raised to the length. Sixteen random characters from a mixed alphabet is far stronger than a clever-looking short one, because an attacker guesses patterns, and a person choosing a password cannot avoid having one.

How it works

Each character is drawn from your chosen alphabet using the browser’s cryptographic random source, crypto.getRandomValues: not Math.random, which is predictable and has no business near a password.

Bytes that would skew the draw are thrown away. A byte runs 0–255 and most alphabets do not divide 256 evenly, so taking the remainder would quietly favour the first few characters; bytes above the last whole multiple are discarded and redrawn instead.

The strength shown is entropy in bits, length × log₂(alphabet size), which is the only measure that means anything for a password nobody chose. Twenty characters over an 86-character alphabet is 128 bits.

What is a random password generator

A password you invented is guessable in a way you cannot feel. Attacks do not try aaa, aab, aac; they try leaked passwords first, then words, then words with a capital and a number and an exclamation mark, because that is what people do when told to use a symbol. Tr0ub4dor&3 looks strong and is not. A generated password has none of that structure, so there is nothing to exploit but the length and the alphabet.

That is what entropy measures. With an alphabet of size A and a length L there are A^L possible passwords, and the entropy is log₂(A^L) = L × log₂(A) bits. Lowercase plus uppercase plus digits is 62 characters, so each one carries 5.95 bits: sixteen of them is 95 bits. Add symbols and the alphabet reaches 86, 6.43 bits a character, and twenty characters cross 128 bits: past the point where guessing is not the attack anyone will bother with.

How long should a password be

Sixteen characters is a sensible floor and twenty or more is right for anything that protects other passwords, such as a password manager's master password or an email account that can reset everything else. Below twelve you are inside the range an offline attacker works through; the old advice of eight dates from when that was expensive and it is not any more.

Length beats composition, and not by a little. Every character you add multiplies the number of possibilities by the size of the alphabet, so going from twelve to sixteen with letters and digits adds about 24 bits: 62 to the fourth, close to fifteen million times the work. Adding symbols to a twelve character password adds under six bits, about fifty times. Both are improvements; they are not the same improvement.

The exception is the password you have to type from memory, where a passphrase of five or six random words is easier to keep and reaches comparable entropy. Everything else belongs in a manager, where nobody has to remember anything and length costs nothing.

  • Up to 12 too short for anything that matters. Use it only where a site refuses more.
  • 16 the working floor for an ordinary account, at about 95 bits with letters and digits.
  • 20 and up for a master password, an email account or anything holding other credentials. Past 128 bits guessing stops being the attack worth mounting.
  • A passphrase instead five or six words chosen at random, for the few passwords you type by hand.

What makes a password strong: length against character sets

Strength is not a property you can see. It is the number of equally likely passwords the attacker has to work through, and that is the alphabet size raised to the length. Which is why "contains a capital, a number and a symbol" is a rule that produces Passw0rd! and measures nothing: the structure is predictable even though the characters are varied.

Turning a character set off here shrinks the alphabet and the entropy with it, which is why the bit count moves as you toggle them. Dropping the characters that look alike, 0, O, 1 and l, costs a little entropy and buys legibility: worth it for a password someone has to read aloud or copy from paper, not worth it otherwise.

When a site will not accept a strong password

Sites that cap the length are the real world intruding. A field that accepts only twelve characters, or rejects symbols, forces a weaker password than you would choose: set the length to their maximum and turn on every set they allow, and remember that a short random password still beats a long memorable one in the same field.

A password you have to remember is a different problem, and a random string is the wrong answer. For the handful you type by hand, the device login, the password manager’s own master password, a passphrase of five or six random words is easier to retain at comparable entropy. Everything else should live in a manager, where nobody needs to remember anything and length costs nothing.

And rotation is mostly superstition. Changing a strong password every ninety days is a habit that pushes people toward Summer2026! and its successors; both NIST and the UK’s NCSC now advise against routine expiry. Change a password when there is a reason to, a breach, a shared device, someone leaving, and make it long rather than frequent.

How to read the bits of entropy

  • Under 50 bits: weak inside reach of a determined offline attack. Fine for something disposable, wrong for anything that matters.
  • 50 to 70 bits: fair safe against online guessing, uncomfortable against a leaked hash database being attacked offline.
  • 70 to 100 bits: strong the working range for an account that matters, assuming the site stores it properly.
  • 100 bits and up: very strong guessing stops being the plausible attack. Phishing, a keylogger or a breach of the service are what remain.
  • The guessing time shown assumes an offline attacker at a trillion guesses a second against a fast hash, and half the keyspace on average. It is a deliberately pessimistic order of magnitude, not a prediction: a site using bcrypt or Argon2 is thousands of times slower to attack, and a site that leaks your password in plain text gives the attacker no guessing to do at all.

Entropy, hashing and salting: the words around passwords

  • Entropy the number of bits of uncertainty in the password. Additive and comparable, which is why it is the right unit and “contains a symbol” is not.
  • CSPRNG a cryptographically secure pseudo-random generator, reached here through crypto.getRandomValues. Math.random is fast, reproducible and seeded: all disqualifying.
  • Modulo bias the skew from folding a 256-value byte onto an alphabet that does not divide it. Small, measurable, and avoidable by rejecting the out-of-range bytes, which is what happens here.
  • Hashing and salting what the site should do with your password on arrival. A slow hash with a per-user salt is why a breach does not immediately become a login.
  • Two-factor authentication the second thing an attacker would need. It covers the case a strong password cannot: the password being stolen rather than guessed.

Questions people ask

How long should a password be?

Sixteen characters is a sound floor and twenty or more is better for anything that protects other accounts. Length buys more security than any particular mix of symbols.

Is a generated password really safer than one I invent?

Yes, substantially. Human passwords follow patterns attackers model directly; a generated one has no structure, so only its length and alphabet matter.

Where does the randomness come from?

crypto.getRandomValues, the browser’s cryptographic random source. Math.random is never used, and bytes that would bias the draw are discarded rather than folded in.

Is the password sent anywhere?

No. It is generated in the page and never transmitted, logged or stored. Disconnect the network and the generator still works.

What do the bits of entropy mean?

They count the uncertainty: length × log₂(alphabet size). Each extra bit doubles the guesses needed, so 128 bits is not twice 64: it is 2⁶⁴ times harder.

Should I change my passwords regularly?

Not on a schedule. Routine expiry pushes people toward predictable variations; both NIST and the NCSC advise changing a password when there is a reason, not by the calendar.