Skip to content

Password Generator

Choose a length and which character sets to include, and get a password generated with cryptographically secure randomness — the same source used for the UUID and hash tools. Shows the real entropy in bits, not just a colored strength bar.

  • Web Crypto randomness, not Math.random
  • Unbiased character selection (rejection sampling)
  • Entropy shown in bits
  • Estimated brute-force time
  • Exclude ambiguous characters

Generator

Generated locally with Web Crypto

How to generate a strong password

  1. 01

    Set the length

    Longer is the single biggest lever on strength — each extra character multiplies the search space, it does not just add to it.

  2. 02

    Choose character sets

    Include lowercase, uppercase, digits and symbols depending on what the target system accepts. More sets per character means more entropy per character.

  3. 03

    Read the entropy, not just the bar

    The bits-of-entropy number and the estimated crack time tell you concretely how strong the result is, instead of a color that means something different on every site.

  4. 04

    Generate and copy

    Each click produces a fresh password from a cryptographically secure random source. Nothing is stored after you leave the page.

Why Math.random has no business generating a password

Math.random() is a fast, statistically-fine pseudorandom generator meant for animations and sampling — and its output is predictable if an attacker can observe enough of it, because JavaScript engines use PRNG algorithms with a knowable internal state, not cryptographic guarantees. Several real password generators built on it have been reverse-engineered for exactly this reason.

crypto.getRandomValues(), which this tool uses, is backed by the operating system's cryptographically secure random number generator — the same category of source used to generate encryption keys. That is the actual bar for anything meant to resist a determined attacker, not just look random to a human glancing at it.

Rejection sampling: the other place randomness quietly breaks

A common shortcut for picking a random character is randomByte % charsetLength. If the charset size does not divide 256 evenly — and almost none do — this systematically favors the characters at the low end of the set. A 62-character alphabet has this bias on every single draw.

This tool avoids it with rejection sampling: it draws a byte, and if that byte would fall in the biased leftover region, it throws it away and draws again. The result is that every character in the set has exactly equal probability, not approximately equal.

What entropy actually measures, and why length wins

Entropy in bits is length × log2(charset size) — the number of times you would have to halve the search space to find the password by guessing. A 12-character password using only lowercase letters has about 56 bits of entropy. Adding uppercase, digits and symbols to reach a 94-character set pushes that same 12 characters to about 78 bits — but going to 16 lowercase-only characters reaches about 75 bits, nearly the same gain from length alone.

The practical conclusion, and the reason most current guidance (including NIST's) emphasizes length over complexity rules: a longer password from a smaller set often beats a shorter one stuffed with symbol requirements, and it is also easier for a human to type correctly.

The crack-time estimate is a scenario, not a promise

The estimated time shown assumes an attacker with offline access to a properly-hashed password database, trying roughly 10 billion guesses per second — a realistic figure for cracking a fast hash like an unsalted MD5 or SHA-256 on modern GPU hardware. Against a service that rate-limits login attempts, or one using a slow, purpose-built hash like bcrypt or Argon2, real attacks are dramatically slower than this number suggests.

What the estimate is actually useful for is comparison: it tells you whether a password you generated here is in the "cracked before you finish reading this sentence" range or the "longer than the estimated age of the universe" range, which matters far more than the exact number of years in between.

Frequently asked questions

Is this password sent to a server?

No. It is generated entirely in your browser using the Web Crypto API. Nothing is transmitted, logged or stored — if you close the tab without copying it, it is gone.

Why not just use Math.random for this?

Math.random is a fast pseudorandom generator with a predictable internal state, not a cryptographic one. An attacker who can observe enough output can potentially predict future values. crypto.getRandomValues draws from the operating system's cryptographically secure random source, which is what password generation actually requires.

Should I prioritize length or character variety?

Length, generally. Entropy grows with length even when the character set stays small, and current guidance from bodies like NIST leans toward longer passwords over complex character-composition rules, partly because arbitrary complexity requirements tend to push people toward predictable patterns instead.

What does the estimated crack time actually assume?

It assumes an offline attack against a fast, poorly-protected hash at about 10 billion guesses per second — a realistic ceiling for cheap hashes on modern hardware. A service using a slow hash like bcrypt or Argon2, or one that rate-limits login attempts, would take vastly longer in practice. Treat the number as a comparison between passwords, not a literal guarantee.

Why exclude ambiguous characters like 0, O, 1 and l?

Purely for humans, not security — those characters look alike in many fonts and are a common source of typos when a password has to be read off a screen and typed somewhere else, like a physical setup sheet or a second device. It slightly reduces the character set, so entropy drops a little; for a password you will only ever copy and paste, you can safely leave it off.

Is a randomly generated password better than a passphrase?

For raw entropy per character, yes — a random password packs more unpredictability into fewer characters than dictionary words do. A passphrase of several random, unrelated words can reach similar entropy with fewer distinct characters and be easier to type or memorize; this tool generates character-based passwords, not word-based passphrases.

Developers

JWT Decoder

Decode the header and payload of a JWT without the token ever leaving your browser.

Developers

.env Validator

Catch quoting, duplicate and syntax bugs in a .env file before they break your deploy.