DevKitHub

API & Security

Secure Password Generator

Generate passwords from your browser’s cryptographic random number generator. Nothing is transmitted, and the strength is reported as entropy rather than a colour bar.

0 lines

Generated in your browser with the Web Crypto API — there is no server endpoint that could produce these, and nothing is transmitted or logged. Entropy is the honest measure of strength: length raises it far more than adding a symbol does.

This tool runs entirely in your browser. Your input is never uploaded, stored or logged.

How it works

Two details separate a correct generator from the many that look correct. The first is the random source. Math.random is a fast pseudo-random generator seeded from the clock, and its output is reproducible by anyone who can narrow down when it ran — which makes any password built from it guessable in a way its length does not suggest. Only crypto.getRandomValues is used here, which draws from the operating system’s cryptographic entropy pool.

The second is modulo bias, and it is subtle enough that most generators have it. Picking a character with randomByte % 87 looks uniform and is not: 256 is not a multiple of 87, so the first 82 characters of the pool come up measurably more often than the last five. Every password inherits a small, real reduction in strength. The fix is rejection sampling — discarding the bytes that land in the uneven tail rather than folding them back in — which costs a handful of extra bytes and makes the distribution actually uniform, which is the only thing that makes the entropy figure honest.

Strength is reported as entropy in bits: log2 of the pool size, times the length. That is the number of guesses an attacker faces, and it is the only measure that means anything. It also shows why the familiar composition rules are largely theatre — a twelve-character password with an uppercase letter, a digit and a symbol carries less entropy than a sixteen-character one made only of lowercase letters. Length dominates everything else.

Common problems

Every example below is run against this tool in our test suite, so what it says here is what the tool actually does.

A "strong" password rejected by the site as too weak.

Why:
Composition rules check for character classes, not entropy. A site can demand a symbol and a digit while happily accepting Passw0rd! — which is among the first few thousand guesses any real attack makes.
Fix:
Satisfy the rule, but choose length for actual strength. Anything above 80 bits of entropy is beyond brute force with current hardware.

The generated password will not paste into the field.

Why:
Some sites block paste in password fields, and some silently truncate to a maximum length — which means the password you set is not the one you saved.
Fix:
Use a password manager’s autofill, and after setting a long password sign out and back in once to confirm it was stored whole.

Ambiguous characters misread when typing the password by hand.

Why:
Capital I, lowercase l and the digit 1 are identical in many fonts, as are capital O and zero. This matters for anything read off a screen and typed on another device.
Fix:
Turn on "exclude ambiguous" for passwords that will be transcribed. It costs a few bits of entropy, which length trivially makes up.

Frequently asked questions

Are the passwords generated on your server?
No, and there is no endpoint that could. They are generated in your browser with the Web Crypto API and never transmitted, stored or logged. A password generator that makes a network request is one you should not use.
How long should a password be?
Long enough to exceed roughly 80 bits of entropy, which with a full character set is about 13 characters and with lowercase letters alone is about 18. Length matters far more than which symbols are included.
What does the entropy figure mean?
The base-2 logarithm of how many passwords could have been generated with the same settings. 60 bits means roughly a billion billion possibilities. It is a property of how the password was generated, not of how the characters look, which is why a memorable-looking password can have low entropy.
Is it safe to use a password from a web page?
This one runs entirely in your browser with no network involved, which you can confirm in the network tab. The larger point is that a password you paste anywhere — including into any online tool — should be treated as exposed, so generate it in your password manager where possible.

Read more about this

Last updated