Skip to content

Strong password generator

The password generator starts you off with 16 characters mixing lowercase, uppercase, numbers and symbols. Change the length or untick a type and the strength is worked out again straight away.

What you enter stays on this device.

The strength of a random password is measured in bits of entropy, roughly its length times the base-2 logarithm of the number of possible characters, so 16 characters drawn from 90 give more than 100 bits.

Entropy bars for a random password drawn from 90 characters: about 52 bits for 8 characters, 78 for 12, 104 for 16 and 130 for 20.

Reading the entropy figure

Entropy counts, in bits, how many different passwords your settings can produce. Every extra bit doubles the number of guesses for anyone trying all the combinations.

entropy ≈ length × log2(number of possible characters)

The tool uses the scale published by ANSSI, the French cybersecurity agency: “very weak” below 64 bits, “weak” from 64 to 80, “medium” from 80 to 100 and “strong” above that. With the 90 characters on offer (26 lowercase, 26 uppercase, 10 numbers and 28 symbols), 12 characters give 77 bits, 14 give 90 and 16 reach 103. The figure shown is exact, because it allows for the rule that every ticked type must appear at least once.

Length matters more than variety. Sixteen lowercase letters on their own are worth 75 bits, almost as much as 12 mixed characters, and you need 22 of them to pass 100 bits. At the other end, a 4-digit PIN has only 10,000 combinations, roughly 13 bits. The number of bits is the base-2 logarithm of the number of combinations: to check it, work out log(10000) ÷ log(2), which gives 13.3.

Entropy by length and character set

Figures calculated by the tool and rounded down. The last column includes 28 symbols; anything in bold reaches 100 bits.

Length0-9a-za-z A-Za-z A-Z 0-9a-z A-Z 0-9 + symbols
82637454750
103347575964
123956687177
144665798390
1653759195103
206694114119129
2479112136142155
32106150182190207

How long for which account?

  • Under 10 characters you stay in “very weak” territory even with symbols: 8 characters give just 50 bits.
  • An everyday account that already has two-step verification: 12 characters at the very least.
  • Your main email, online banking and above all the master password of a password manager deserve 16 or more. That is where you cross 100 bits.
  • If it lives in a password manager and you never type it, 24 or 32 characters cost you nothing.

What the generator leaves out

Quotation marks, the apostrophe, backslash, backtick and space never appear, because too many forms reject or mangle them. The “no look-alike characters” option also drops 0, O, o, 1, l, I and |, which helps when you have to copy a password off a label, such as the Wi-Fi key on a router. That leaves 83 characters, and 16 of them still give 101 bits.

Every character comes from crypto.getRandomValues, the source of randomness browsers provide for cryptographic use. Math.random, JavaScript's everyday random function, is not used; the MDN documentation advises against it for anything security-related. It is the same source used to draw a name at random without favouring anyone.

Once you have copied it

One password per account, no exceptions, so that a breach on one site leaves your other accounts locked. Nobody remembers twenty strings like this, which is what a password manager is for: you are left with a single master password to look after. Turn on two-step verification for email and banking too, as the UK National Cyber Security Centre advises.

Need a username to go with it? The username generator draws them at random in the same way, and there are more tools of this kind under text tools and generators.

Method and sources

References used:

This tool is checked by automated tests against known cases. Spotted a mistake? Report it on the contact page.

Last updated

Frequently asked questions

How long should a password be?
16 characters with all four types: 103 bits, above the “strong” threshold.
Is 12 characters enough?
With all four types, 12 characters give 77 bits, which the ANSSI scale rates as “weak”. For an account that locks out repeated attempts and asks for a second factor, that will do. For email or banking, go to 16.
Does the password go to a server?
No. It only exists on the page until you copy it. All that stays on your device is your settings (length and ticked boxes), ready for next time.
Why never quotation marks or spaces?
Many forms and programs reject these characters or misread them, along with the apostrophe, backslash and backtick. So they are left out from the start.
What if I have to type it in by hand?
Tick “no look-alike characters”, and you will no longer mix up 0 and O or 1 and l. You lose a little entropy: 101 bits instead of 103 for 16 characters.
A website won't accept symbols. What now?
Untick them and add one character. Without symbols, 17 characters are enough to pass 100 bits. If length is the problem, NIST asks sites to accept at least 64 characters, though not all of them do.
How long does it take to crack a password?
There is no honest single figure: it depends on the attacker's computing power and on how the site stores passwords. What is certain is that every bit of entropy doubles the guesses needed. Beyond 100 bits, trying everything is out of reach.
Do I need to change it every three months?
Not if it is strong and unique: the UK NCSC and the US NIST no longer recommend forced changes on a fixed schedule. Do change it straight away if a breach or a suspicious login is possible.