Skip to content

Strong password generator

Generate random passwords with the length and characters you choose, and see exactly how much entropy they carry.

Runs in your browser. Nothing you paste is sent to us.

Settings

1 to 256 characters. 16 or more is a good floor for anything that matters.

Passwords

129.7 bits of entropy 90 possible characters

Each character is drawn from your browser’s cryptographic random generator, without bias. The entropy is exact for these settings: it counts every password they could produce.

How to use it

  1. Set the length. 16 characters or more suits most accounts.
  2. Choose the kinds of characters: lowercase, uppercase, digits and symbols.
  3. Leave out look-alikes such as l, 1 and O if someone will type the password by hand.
  4. Copy one of the passwords, or press Generate again for a new set.

What to know

Every character comes from your browser’s cryptographic random generator (crypto.getRandomValues), with rejection sampling so no character is more likely than another.

The entropy shown counts every password the settings could produce. When you ask for one of each kind, passwords missing a kind are thrown away and redrawn, and the count leaves them out too.

Keycloak checks new passwords against the realm’s password policy, such as a minimum length or a number of digits, special characters and uppercase letters. Match the generator’s settings to the policy before you set a user’s password.

What a random password is, and why random matters

A password protects an account only as well as it resists guessing. People who make up passwords follow habits: a word, a capital at the start, a number and a symbol at the end. Attackers know those habits and try them first, so a password that looks complex can fall in minutes.

A random password has no habits to exploit. Every character is picked by a cryptographic random generator, so the only way to find it is to try the possible passwords one by one. How many there are depends on two things you control: the length and the set of characters.

This generator makes those passwords in your browser and tells you exactly how strong they are, in bits of entropy, for the settings you chose.

How password entropy is measured

Entropy counts the possible passwords as a power of two. A password with 80 bits of entropy is one of 2^80 equally likely passwords. Each extra bit doubles the work for an attacker.

For a password of length L drawn from an alphabet of N characters, the count is N^L and the entropy is L × log2(N). Length multiplies; a bigger alphabet only adds a little per character.

CharactersAlphabet sizeBits per character16 characters
Digits only103.3253 bits
Lowercase264.7075 bits
Lower and upper525.7091 bits
Letters and digits625.9595 bits
Letters, digits and 28 symbols906.49104 bits

The figure only holds when the password really is random. A made-up password of the same length has far less, because its characters are not independent choices.

Why "one of each kind" changes the count

Many policies want at least one uppercase letter, one digit and one symbol. A generator that forces this produces fewer possible passwords than one that does not, because passwords missing a kind are ruled out.

This tool counts that exactly with inclusion and exclusion: all passwords over the full alphabet, minus those missing each kind, plus those missing two kinds, and so on. For 20 characters over 90 symbols the loss is a fraction of a bit, which is why the setting is on by default.

How this generator picks characters

Randomness comes from crypto.getRandomValues, the browser’s cryptographically secure generator. It is the same source the browser uses for its own keys.

A common bug in password generators is modulo bias. Taking a random 32-bit number and computing value % 90 makes some characters slightly more likely than others, because 2^32 is not a multiple of 90. This tool uses rejection sampling instead: it throws away the few values at the top of the range that would cause bias and draws again.

Rejection sampling, as used here
limit = 2^32 - (2^32 mod 90)
repeat:
  value = random 32-bit number
until value < limit
character = alphabet[value mod 90]

When you ask for one of each kind, the tool draws a whole password and keeps it only if every kind is present. Redrawing whole passwords keeps the result uniform over the passwords that qualify. Patching a password afterwards, for example by swapping in a digit at a random place, would not.

What this tool does and does not do

  • It generates one, five or ten passwords from 1 to 256 characters, from the kinds of characters you choose.
  • It can leave out look-alike characters (I, l, 1, |, O, 0, o) for passwords someone must read aloud or type from paper.
  • It shows the exact entropy for the current settings and the size of the alphabet.
  • It does not store, log or send any password. Nothing leaves the page unless you copy it.
  • It does not check a password you made yourself. Use the password strength checker for that.

The symbol set leaves out the double quote, single quote, backslash and backtick. Those characters often need escaping in shells, JSON, YAML and environment files, and a wrongly escaped password is a common cause of failed logins after a deploy.

How to generate a password

  1. Set the length. For accounts a person types, 16 to 20 characters is a good range. For secrets only machines read, go longer.
  2. Choose the kinds of characters. Keep all four unless a system rejects some.
  3. Tick "Leave out look-alikes" if the password will be read by a person.
  4. Keep "At least one of each chosen kind" on if a password policy requires it.
  5. Copy one password. Press Generate again for a fresh set; each set is independent.

Copy only the password you use. The clipboard can be read by other apps on some systems, so paste it into your password manager or the target system right away.

Where generated passwords fit in identity work

Random passwords are most useful where no person has to remember them, or where a password manager remembers them for the person.

Admin and break-glass accounts

An identity provider’s first admin account, or an emergency account kept for when single sign-on fails, should have a long random password kept in a vault. In Keycloak this means the initial admin of the master realm, and any realm admin you create for recovery. Pair it with a second factor.

Temporary passwords for new users

When an admin sets a first password for a user, Keycloak can mark it temporary so the user must change it at first sign-in. A random temporary password avoids the common pattern of a shared default such as the company name and the year.

Service and database accounts

Keycloak connects to its database with a user and password. That password is read from configuration by a machine, so it can be long and use letters and digits only, which avoids escaping problems. For OAuth clients, use the client secret generator instead, which works in bytes and Base64url.

Meeting a password policy

Keycloak checks new passwords against the realm’s password policy, which can require a minimum length, digits, lowercase and uppercase letters, special characters, and more. Match the generator’s settings to the policy before setting a password, so it is not rejected.

How long should a password be?

It depends on how the password could be attacked.

SituationSuggested entropyExample setting
Online sign-in with rate limits or lockout50 bits or more10 characters, all kinds
Account whose hash might be stolen80 bits or more13 characters, all kinds
Admin, vault master or break-glass account100 bits or more16 characters, all kinds
Secret only machines read128 bits or more22 letters and digits, or a generated key

These are working guidelines, not a standard. The point is the gap: an online attacker is slowed by the server, while an attacker with a stolen hash can guess as fast as their hardware allows.

Common mistakes and how to avoid them

  • Relying on many kinds of characters instead of length. Twelve characters from 90 symbols (78 bits) is only slightly stronger than 16 lowercase letters (75 bits), and much harder to type. Add length first.
  • Editing the generated password to make it easier. Any change a person makes reintroduces a pattern.
  • Reusing one generated password in several places. A strong password reused on a breached site is no longer secret.
  • Pasting a password with a trailing space or line break. Some systems keep it as part of the password.
  • Putting quotes or backslashes in passwords that go into config files. The default symbol set here avoids them for that reason.

Security notes

NIST Special Publication 800-63B, the US guidance on authentication, advises verifiers to accept long passwords (at least 64 characters), to check new passwords against lists of known compromised values, and not to impose composition rules or regular forced changes. A random password from a manager satisfies all of that without effort from the user.

How the server stores the password matters as much as the password. A system should store it with a slow, salted function such as Argon2, scrypt, bcrypt or PBKDF2, never a plain hash. See the PBKDF2 hasher for how that works.

A password generated here never leaves your browser. Even so, generate production credentials on a device you trust, and close the tab when you are done.

Best practices

  • Store every generated password in a password manager or a secrets vault, never in a note or a chat message.
  • Use a different password for every account and every environment.
  • Turn on a second factor for any account that matters, especially admin accounts.
  • Prefer passkeys or single sign-on where the service supports them; then most users have no password to manage at all.
  • Rotate a password when it may have been exposed, not on a fixed calendar.
Questions

Frequently asked questions

Is a password from an online generator safe to use?

It is safe when the password is made in your browser and never sent anywhere, as here. Check that a generator uses the browser’s cryptographic random source and does not send the result to a server. If you are unsure, generate passwords in your password manager.

How many characters should a strong password have?

For a random password with all four kinds of characters, 16 characters gives about 104 bits, which is beyond guessing. For passwords a person types often, 12 to 14 random characters is a reasonable floor. Passwords made up by people need to be much longer to reach the same strength.

Are symbols necessary in a password?

No. Symbols add strength per character, but length adds more. A 20-character password of letters and digits has about 119 bits. Use symbols when a policy requires them or when you need a shorter password.

What is modulo bias in a password generator?

It is a small skew that appears when a random number is reduced with the remainder operator to pick a character. Some characters end up slightly more likely than others. Rejection sampling, which this tool uses, removes the skew.

Why does the entropy drop when I require one of each kind?

Because passwords that lack one of the kinds are no longer possible, so there are fewer passwords in total. The drop is small for long passwords. The number shown is the exact count for your settings.

Should I change my passwords regularly?

Current guidance, including NIST SP 800-63B, says not to force regular changes. Change a password when there is a reason, such as a breach or a sign it was shared. Forced rotation tends to produce predictable variations.

Can I use this for Keycloak admin passwords?

Yes. Use a long password, at least 16 characters, store it in a vault and turn on a second factor for the account. Make sure it meets the realm’s password policy.

Is the password stored or logged anywhere?

No. It exists only in this page’s memory until you copy it or leave. Nothing is sent over the network.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.