Password Generator

Generate strong, cryptographically secure passwords instantly.

🔒100% client-side — your password is generated in your browser and never sent to any server.
Password StrengthWeak

Options
Length16
Bulk Generator

What makes a strong password?

A strong password combines four properties that make it resistant to attack:

  • Length > 16 characters. Every extra character multiplies the search space exponentially. Aim for 20+ characters on critical accounts.
  • Mixed character sets. Combine uppercase, lowercase, digits, and symbols to dramatically increase entropy.
  • No dictionary words or patterns. Substitutions like “P@ssw0rd” are well-known to attackers and offer little real security.
  • Unique per site. Reusing passwords means a single breach exposes all your accounts. Use a password manager to keep unique passwords for each service.

How does this password generator work?

Every password is generated entirely inside your browser using window.crypto.getRandomValues(), the Web Crypto API built into every modern browser. This API draws from the operating system's cryptographically secure pseudo-random number generator (CSPRNG) — the same source used for TLS keys and other high-security operations.

No data is sent to a server. This page has no backend logic for password generation. The characters are assembled in memory, displayed in your browser, and discarded the moment you leave the page. We use rejection sampling to avoid modulo bias, and a Fisher-Yates shuffle to guarantee uniform character distribution.


Password entropy explained

Entropy quantifies how unpredictable a password is. It is calculated as:

E = L × log₂(N) where: L = password length (characters) N = size of the character pool

For example, a 16-character password using all four character sets (N = 95) has approximately 104 bits of entropy — far beyond what any current hardware can brute-force in a reasonable time frame.

LengthCharsetPool size (N)Entropy (bits)
8Lowercase only2638
8Lower + Upper + Numbers6248
12Lower + Upper + Numbers6271
16All (+ Symbols)95105
20All (+ Symbols)95131
32All (+ Symbols)95210

Generate passwords in Python

Use the secrets module (not random) for cryptographically secure password generation in Python:

import secrets
import string

def generate_password(length=16, use_symbols=True):
    """Generate a cryptographically secure random password."""
    alphabet = (
        string.ascii_uppercase +
        string.ascii_lowercase +
        string.digits +
        (string.punctuation if use_symbols else "")
    )

    # Guarantee at least one character from each required group
    required = [
        secrets.choice(string.ascii_uppercase),
        secrets.choice(string.ascii_lowercase),
        secrets.choice(string.digits),
    ]
    if use_symbols:
        required.append(secrets.choice(string.punctuation))

    # Fill the rest of the password
    remaining = [secrets.choice(alphabet) for _ in range(length - len(required))]

    # Shuffle to avoid predictable positions
    password_chars = required + remaining
    secrets.SystemRandom().shuffle(password_chars)

    return "".join(password_chars)


# Generate 5 passwords
for _ in range(5):
    print(generate_password(length=20))

The secrets module was added in Python 3.6 and is designed for generating cryptographically strong random numbers suitable for managing data such as passwords, account authentication, and security tokens.

Frequently Asked Questions

Is this password generator safe?

Yes. The password is generated entirely in your browser using the Web Crypto API (window.crypto.getRandomValues). No password is ever transmitted to a server or stored anywhere.

What is a strong password?

A strong password is at least 16 characters long and combines uppercase letters, lowercase letters, numbers, and symbols. It should not contain dictionary words or personal information, and should be unique for every account.

How long should a password be?

Security experts recommend a minimum of 16 characters for most accounts. For highly sensitive accounts such as banking or email, 20+ characters is advisable. Longer passwords increase entropy exponentially, making brute-force attacks impractical.

What is password entropy?

Password entropy measures how unpredictable a password is, expressed in bits. It is calculated as log₂(N^L) where N is the size of the character pool and L is the password length. Higher entropy means a harder-to-crack password — 80+ bits is generally considered strong.