Password Generator
Generate secure random passwords with custom length and character sets.
Related calculators
About
Password Generator
The generator above builds a password in your browser and shows two things about it: how much entropy it carries, in bits, and where that lands on a five step strength scale. Nothing is transmitted. The password is not sent to a server, not logged, and not stored, and the only thing this page ever writes to your browser is your option settings, and only if you press save.
How the randomness is produced
Characters come from crypto.getRandomValues, the browser's cryptographically secure random number generator, rather than from Math.random. That distinction matters more than it sounds. Math.random is built for speed, its output is predictable from enough samples, and it was never designed to keep secrets.
Each character is also drawn with rejection sampling rather than by taking a random number modulo the set size. Modulo is the obvious approach and it is quietly biased: 232 does not divide evenly by 68, so the first few characters in the set would come up slightly more often than the rest. The bias is small, but it is free to avoid, so the generator throws away the values that would skew the result and draws again.
What entropy actually measures
Entropy is the size of the haystack, expressed in bits. For a password chosen at random it is the length multiplied by the base-2 logarithm of the character set:
entropy = length × log2(set size)
With the default options the set holds 68 characters, which is log2(68) or about 6.09 bits per character. Sixteen of them gives 97.4 bits, meaning the password is one of roughly 297 equally likely possibilities. An attacker checking every one would find it after half of them on average.
The word random is carrying the weight in that sentence. Entropy describes the process that produced the password, not the string itself. Tr0ub4dor&3 looks like it has plenty of entropy and has very little, because it was built from a dictionary word with predictable substitutions, and that is exactly what cracking software tries first.
What each character type buys you
| Character types | Set size | Bits per character | 16 characters |
|---|---|---|---|
| Lower case only | 26 | 4.70 | 75.2 bits |
| Upper and lower | 52 | 5.70 | 91.2 bits |
| Letters and digits | 62 | 5.95 | 95.3 bits |
| The default here | 68 | 6.09 | 97.4 bits |
| Everything, nothing excluded | 94 | 6.55 | 104.9 bits |
Look at the last column rather than the middle one. Going from letters only to the full printable set adds 0.85 bits per character, while adding four more characters to a lower case password adds 18.8. Length is the cheaper lever by a wide margin, which is why a long passphrase beats a short mess of punctuation.
How long a password survives
These figures assume an offline attack against a fast hash such as MD5 or SHA-1, where a rig of GPUs tests on the order of a trillion guesses a second, and they show the average rather than the worst case.
| Entropy | Average time to guess |
|---|---|
| 40 bits | under a second |
| 50 bits | 9 minutes |
| 60 bits | 7 days |
| 70 bits | 19 years |
| 80 bits | 19,000 years |
| 97 bits (this page's default) | 2.5 billion years |
| 128 bits | longer than the universe has existed, many times over |
Two caveats keep this honest. Against a slow password hash such as bcrypt or Argon2, which is what a competent service uses, the same hardware manages thousands or millions of guesses a second rather than a trillion, so every row shifts enormously in your favour. And against a login form with rate limiting, brute force is not the threat at all.
Which is the real point. Passwords with this much entropy are not broken by guessing. They are lost through a breach at the service that held them, through reuse across sites, or through a convincing fake login page. The generator handles the part that arithmetic can handle; the rest is habits.
Ambiguous characters and brackets
The ambiguous option removes characters that look alike in most fonts: capital I, lower case l and the digit 1 are nearly identical in many sans-serif faces, and O against 0 is not much better. Punctuation such as the backtick, the apostrophe, the comma and the full stop is included too, since those disappear at small sizes and get eaten by autocorrect.
Brackets are separate because they cause a different problem. Some systems, particularly older ones and anything that pipes input through a shell or a query, mishandle them.
Both options cost you something, and it is worth knowing how much. Excluding both drops the set from 94 characters to 68, which at 16 characters is 97.4 bits instead of 104.9, so the haystack is about 178 times smaller. That sounds severe and is not: adding a single character brings it back to 103.5 bits. If you are transcribing a password by hand or reading it aloud, take the exclusions and add a character or two.
Why no repeated characters makes it weaker
This option is the one people misread. Forbidding repeats feels tidier and it lowers entropy every time, because each choice you make removes an option from the ones that follow.
With repeats allowed, all 68 characters are available at every position, so entropy is 16 × log2(68) = 97.4 bits. Without repeats the set shrinks as you go, and the total is log2(68 × 67 × 66 × ... ), which is 94.6 bits. You have thrown away nearly three bits and told an attacker something useful about the structure, which is that no character appears twice.
It is a small loss and it is a loss. Use the option when a system genuinely rejects repeats, not because it looks more random.
Making a password you can actually remember
Generated passwords belong in a password manager. For the handful you have to type from memory, the master password for the manager, your device login, build a passphrase instead: several unrelated words chosen at random, not picked by you.
Random selection is the whole trick. Four words drawn from a 7,776 word list carry 51.7 bits, and six words carry 77.5, which beats almost anything a person invents unaided. Words you choose yourself, from your own vocabulary and associations, carry a fraction of that no matter how unlikely the sentence feels.
The rules worth keeping from conventional advice are the exclusions rather than the inclusions. Keep out anything drawn from your own life: names, birthdays, pets, addresses, the company you work for and its abbreviations. Keep out anything with a predictable shape, such as dates, phone numbers and licence plates. And check anything you invented against a breach list, because a password can be original to you and still appear in a leak of a billion others.
Protecting it once you have it
Never reuse it. This is the single highest-value habit. When a site is breached, attackers take the leaked pairs and try them everywhere else, an attack so routine it has a name, credential stuffing. One unique password per account turns any breach into a single-site problem, and a password manager is what makes that practical.
Turn on two-factor authentication. A second factor keeps an account standing even when the password is already gone. An authenticator app or a hardware key beats SMS, which can be redirected by taking over the phone number.
Do not share it, and treat any password you have shared as one you now need to change. The risk is not that the other person is careless with intent; it is that your secret is now stored somewhere you cannot see.
Stop rotating passwords on a schedule. This reverses the advice most people were taught, and the reversal is official: NIST guidance now tells organisations not to force periodic changes without evidence of compromise, because in practice people respond to forced rotation by making small predictable edits to a password they already had. Change a password when there is a reason to, immediately and completely.
Keep it out of plain sight. A note on a desk, a file called passwords, or a phone note synced to a cloud account are all easier to reach than the accounts they protect. And be careful where you sign in: saved passwords on a shared or public machine outlive your session.
Reading your result
Take the bits figure rather than the word. The label is a bucket, and 60 bits and 127 bits both read as strong while being about a quintillion times apart in difficulty.
For most accounts, 16 characters from the default set is far past the point where guessing is the weak link, which is why this generator starts there rather than at the shorter defaults common elsewhere. Go longer where the account really matters, a password manager, an email account, anything financial, since email is the reset path for everything else. And if a site refuses a long password or silently truncates it, treat that as information about how carefully it is storing what you gave it.
Common questions
Frequently asked questions
The password is generated entirely in your browser using crypto.getRandomValues, the browser's cryptographic random number generator. It is never sent over the network, never logged and never stored. You can confirm that by disconnecting from the internet and pressing regenerate, since it keeps working.
Entropy measures how many equally likely passwords could have been produced, expressed in bits. It is the length multiplied by the base-2 logarithm of the character set, so 16 characters from a 68 character set is about 97 bits, or one of roughly 2 to the power 97 possibilities.
Below 40 bits is guessable in seconds against a fast hash, 60 bits buys about a week, and 80 bits is out of practical reach. Anything at or above 80 bits is comfortable for a normal account, and the 16 character default here gives around 97.
Sixteen characters is a good default for anything that matters, and longer for a password manager or email account. Length is worth more than punctuation: adding one character to a 68 character set adds about 6 bits, while switching a whole password to the full symbol set adds under one bit per character.
Because capital I, lower case l and the digit 1 look almost identical in many fonts, as do O and 0. If you will ever type the password by hand or read it aloud, excluding them prevents lockouts. It costs a little entropy, which you can win back by adding one character.
No, it makes it slightly weaker. Every character you use removes an option from the remaining positions, so 16 characters from a set of 68 drops from 97.4 bits to 94.6. Use the option only when a system rejects repeats.
Not on a schedule. Current NIST guidance advises against forcing periodic changes without evidence of compromise, because people respond by making small predictable edits. Change a password immediately if a service is breached or you suspect it is known.
For anything you must memorise, yes, provided the words are chosen at random rather than by you. Six words from a 7,776 word list carry about 77 bits and are far easier to type than a random string. For everything stored in a password manager, a generated password is the better choice.