Password Generator

Pick the length, character types and quantity, then generate cryptographically random passwords with a real entropy and strength readout.

Drag, or type any length from 1 to 128.

How to use

  1. Drag the Length slider (or type a length) and pick the character types you want: A-Z, a-z, 0-9 and symbols.
  2. Turn on No 0 O 1 l I if the password will be handwritten, read aloud, or typed on a device where 0/O or 1/l/I are easy to confuse.
  3. Pick How many to generate at once if you need several, for different accounts, or to pick a favourite; each one gets its own Copy button.
  4. Copy (or Copy all) or Download .txt. The bar under the password shows its strength, entropy and a rough guessing time; every password in a batch is equally strong, since they share the same options.

What makes a password generator trustworthy

Two things matter for a password generator, and most of what makes one better than another comes down to them. First, the randomness: passwords must come from a cryptographically secure random number generator, not an ordinary one. Math.random() is fast and fine for a game or a UI animation, but it is not specified to be unpredictable, and some implementations of it can be predicted after seeing enough output. This tool uses crypto.getRandomValues() instead, the Web Crypto API's CSPRNG, the same source browsers use for TLS keys. Second, where the password is computed: if it happens on a server, the operator could log it, by accident or on purpose. This page has no server: it is a static file, and every password is generated by JavaScript running on your device.

What the tool will not do is pretend a password is safe because it is long. A password is only as good as where it ends up: reused across sites, pasted into a chat, or stored in a browser with no master password all undermine even a maximally random one. Use a password manager to store what this generates.

Example

The default settings (16 characters, all four character types, no exclusions) draw from a88-character pool and produce something like:

6ey@Oa;o93V3Z2h^

That password carries 103.4 bits of entropy (Very strong), with a88-character pool, every extra character adds about 6.5bits, so length matters more than which character types you enable.

Options explained

Edge cases and common errors

Do the same thing in code

JavaScript (browser or Node.js)

function randomPassword(length, charset) {
  const bytes = new Uint8Array(length);
  crypto.getRandomValues(bytes);
  return Array.from(bytes, (b) => charset[b % charset.length]).join("");
  // Note: "b % charset.length" is a simplification and reintroduces a small
  // modulo bias unless charset.length evenly divides 256 -- this page's own
  // engine (src/lib/password-generate.ts) uses rejection sampling instead.
}
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>/?";
const password = randomPassword(16, charset);

Python

import secrets, string
charset = string.ascii_letters + string.digits + "!@#$%^&*()-_=+[]{};:,.<>/?"
password = "".join(secrets.choice(charset) for _ in range(16))  # secrets, never random

Shell

openssl rand -base64 24 | tr -d '=+/' | cut -c1-16   # quick, but not character-type-aware
pwgen -sy 16 1                                       # if pwgen is installed

Once you have a password, a UUID is the usual next thing generated alongside it for a new account or API key; if the account needs a JWT decoded later, the JWT decoder is the tool for that.

Password Generator FAQ

Is it safe to generate a password on a website?

On this one, yes, because there is nothing to intercept: the page is a static file with no server behind it, and every password is generated by JavaScript running in your own browser using the Web Crypto API. Nothing you generate is sent anywhere, logged, or stored. Reload the page and it is gone. That is not true of every password generator online; some genuinely do compute the password server-side and could log it.

How random are these passwords, really?

Every character comes from crypto.getRandomValues(), the browser's cryptographically secure random number generator (the same source used for encryption keys), not JavaScript's Math.random(), which is not specified to be unpredictable and must never be used for anything security-sensitive. Characters are drawn with rejection sampling so no character in the chosen set is even slightly more likely than another.

What do the entropy number and strength label mean?

Entropy in bits is log2(pool size) × length: roughly, how many yes/no guesses an attacker who knows your character set (but not the password) would need on average to find it by brute force. It is a measure of the random space searched, not a guarantee against a leaked password reused elsewhere or a targeted guess. The Weak/Fair/Strong/Very strong label is an approximate, commonly used band on that number, not a certified score.

Should I exclude ambiguous characters?

Turn it on if a human will ever need to read or retype the password: handwritten on a sticky note, read aloud over the phone, displayed in a font where 1, l and I look identical. Leave it off for a password a password manager stores and autofills, since removing characters only shrinks the pool and very slightly lowers the entropy for the same length.

Why does a very short password not include every character type I selected?

The tool guarantees at least one of each selected type only when the length allows it; with 4 types selected, that needs at least 4 characters. Below that it fills the password from the combined pool instead of silently dropping one of your choices. A 4-character password with all four types selected might read "sD[7", which happens to have no symbol this time; a length of at least 4 with those settings will always try for one of each, but a length of 3 or fewer cannot.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta.