Security Guide

How to Generate a Secure Password — Step-by-Step Guide 2026

A complete guide to generating genuinely secure passwords — covering the science of randomness, what makes passwords weak, how to choose the right length and character set, and the tools to use.

Step 1 — Understand What Makes Passwords Weak

Before generating a secure password, it helps to understand why most passwords fail. Security researchers analysing breach databases consistently find the same patterns:

The common thread: human-generated passwords are not random. A genuine random generator with sufficient entropy eliminates all of these weaknesses at once.

Step 2 — Choose Your Length

Length is the single most impactful parameter for password security. Each additional character multiplies the keyspace by the number of possible characters at that position.

For a full 94-character ASCII set: 12 characters → 78.7 bits, 16 characters → 104.9 bits, 20 characters → 131.1 bits. 80 bits is the commonly cited threshold for 'computationally secure' under current hardware. 100+ bits is effectively unbreakable with any foreseeable technology.

Recommendation: Use 16 characters minimum for all accounts. Use 20+ for email accounts (the master key to all other accounts), your password manager's master password, and banking credentials.

Step 3 — Choose Your Character Set

Enabling more character types expands the pool of possible characters, increasing entropy per character:

Character TypesPool SizeBits per Char
Lowercase only (a–z)264.7 bits
+ Uppercase (A–Z)525.7 bits
+ Digits (0–9)625.95 bits
+ Symbols (!@#$…)946.55 bits

If a website limits you to a small character set (numbers only, or no symbols), compensate by increasing length.

Step 4 — Generate Using Cryptographic Randomness

Never create passwords manually — the human brain cannot generate true randomness. Instead, use a generator that calls crypto.getRandomValues(), the browser's Web Crypto API.

This API draws entropy from the operating system's entropy pool — hardware events like mouse movement, CPU timing jitter, and disk access — making the output genuinely unpredictable. The same source is used by TLS, SSH, and full-disk encryption.

Step 5 — Verify and Store Safely

After generating, check your password against breach patterns using the Breach Pattern Checker, which analyses 15+ common breach patterns locally without sending any data to a server.

Store generated passwords in a reputable password manager — never in a plaintext file, browser autofill without a master password, or a spreadsheet. Enable two-factor authentication on your password manager account for an additional layer of protection.

Frequently Asked Questions

What is the most secure way to generate a password?
Use a tool that calls crypto.getRandomValues() — the browser's hardware-backed cryptographic random number generator — and runs entirely client-side with no server communication. Combine a length of at least 16 characters with uppercase, lowercase, digits, and symbols.
Should I use a password manager?
Yes. A password manager allows you to use a unique, randomly generated password for every account without needing to remember them. You only need to remember one strong master password — ideally a long passphrase. Use a reputable manager with a proven security track record.
How often should I change my passwords?
Modern guidance (NIST SP 800-63B) recommends against mandatory periodic password rotation unless there is evidence of compromise. Change passwords immediately if a breach is suspected, if you shared a password with someone who should no longer have access, or if you logged in on an untrusted device.
What characters make a password hardest to crack?
Symbols and uppercase letters contribute most to expanding the character pool. A password using all four character types (uppercase, lowercase, digits, symbols) draws from a pool of 94 characters, compared to 26 for lowercase-only. More importantly, length multiplies entropy: adding one character to a 16-character password using a 94-character pool adds 6.5 bits of entropy.