Please enable JavaScript to use CodeHS

Cybersecurity

Safe Password Generator

A strong password is one of the easiest ways to stay safe online. Learn what makes a password hard to crack, then build your own secure password below.

Security ~8 min Middle / High school
The Big Idea

What makes a password strong?

A password is strong when it is hard for a computer to guess. Two things matter most:

  • Length: Every extra character makes the password exponentially harder to crack. A 12-character password can be thousands of times stronger than an 8-character one.
  • Variety: Using uppercase letters, lowercase letters, numbers, and symbols increases the number of possible characters at each position.

Simple definition: Strength = length × character variety. A longer password with mixed characters is much harder to guess than a short one made of only lowercase letters.


Interactive

Try it: Safe Password Generator

This tool works like the CodeHS Safe Password Generator PowerUp. Choose the length and character types, then click Generate Password. Copy it when you are ready.

Password Generator
12
Strength —


How It Works

Entropy in action

Password strength is often measured in bits of entropy. Entropy is a way of counting how many different passwords a tool would have to try to guess yours.

If you use 26 lowercase letters, each character adds about log₂(26) ≈ 4.7 bits of entropy. Add uppercase, numbers, and symbols, and the alphabet grows to 94 possible characters, giving about 6.6 bits per character. A 16-character password from that pool has over 100 bits of entropy — far too large for an attacker to brute-force.

Pool size94
Length12
Possible combinations—
Approximate entropy—

Try this: Change the length and character options above. Watch how the entropy bar and the number of possible combinations grow.


Real World

Common password mistakes

Even a long password can be weak if it is easy to guess. Avoid these traps:

  • Dictionary words: "Password123" and "Sunshine!" are common and appear on attacker word lists.
  • Personal information: Birthdays, pet names, and favorite sports teams are easy to find online.
  • Short passwords: An 8-character password can be cracked in minutes with modern tools.
  • Reusing passwords: If one site is breached, every account with the same password is at risk.

The safest approach is to let a password manager generate and remember a unique, random password for every account.


Check Yourself

Quick quiz

1. Which usually makes a password stronger?

2. Why is reusing passwords risky?

3. What is entropy?

Keep exploring cybersecurity

Strong passwords are just the start. A password manager can remember a unique one for every site, so you never have to.

Part of the Cybersecurity Basics tutorial series.