Password Strength Checker
Type a password and see its estimated entropy, the penalties it triggers (repeats, sequences, keyboard walks, common words hidden behind leetspeak), an offline crack-time estimate, and a rule checklist. Everything runs in your browser. The password is never stored or sent anywhere.
Check a password
Crack time (offline)
Character pool
Length
Penalties
- None detected yet.
Rule checklist
- Waiting for input.
Settings
Settings are saved in localStorage. The password is never written to storage or sent over the network. It stays in the input field only.
Step 1 — Estimate entropy and apply penalties
Entropy is the number of bits needed to describe a random choice. A password built by picking each character uniformly from a pool of size N with length L has L × log2(N) bits. That is the ceiling for a random password. Real human passwords fall short of it, so the checker subtracts a penalty for each predictable pattern it finds.
The NIST digital identity guidelines (NIST SP 800-63B) recommend length as the main factor and say composition rules alone add little. That is why the tool keeps the length check first and treats symbols as optional by default.
function poolSize(pw) {
let pool = 0;
if (/[a-z]/.test(pw)) pool += 26;
if (/[A-Z]/.test(pw)) pool += 26;
if (/[0-9]/.test(pw)) pool += 10;
if (/[^a-zA-Z0-9]/.test(pw)) pool += 33;
return pool;
}
const naiveBits = pw.length * Math.log2(poolSize(pw));
// Repeated runs like "aaa" cost 6 bits each
const repeats = pw.match(/(.)\1{2,}/g) || [];
const effectiveBits = Math.max(0, naiveBits - 6 * repeats.length); What the penalties catch
- Repeats —
aaa,1111. Each run is nearly free to guess. - Sequences —
abc,987. Attackers try these first. - Keyboard walks —
qwerty,asdf,1234. - Common words — checked after undoing leetspeak, so
p@ssw0rdis read aspassword.
Penalty weights are heuristic. They are a rough signal, not a substitute for a real estimator such as zxcvbn, which models dictionary, spatial, and date patterns with far more depth.
Step 2 — Add rules with the plugin API
Every checklist item is a rule object with an id, a label, an optional enabled(settings) gate, and a check(pw, settings) function that returns true when the password passes. Built-in rules use the same shape as yours, so a custom rule is a single call to PasswordStrength.register.
// Paste into the browser console on this page
PasswordStrength.register({
id: 'no-keyboard-walk',
label: 'No keyboard walks',
check: (pw) => !/qwerty|asdf|zxcv/i.test(pw),
});
// Rules are checked on every keystroke and the checklist re-renders
PasswordStrength.rules.map((r) => r.id);
// ["min-length", "lower", "upper", "digit", "symbol", "no-common", "no-repeats", "no-space", "no-keyboard-walk"] Keep rules pure: no network calls and no storage of the password. A rule that writes the password anywhere would undo the privacy guarantee this page makes.
Any enabled rule that fails caps the score at "Fair", so a password cannot read as strong while failing a required rule.
Built as one self-contained .astro file with inline CSS and JS. No libraries, no network calls. The common-word list has 26 entries and the keyboard list has 8. The estimator runs in under a millisecond on typical passwords. Settings persist in localStorage. Nothing is written about the password.
Lessons Learned — Build Process
What the checker taught us while building it.
Length beats complexity rules
Composition rules (must include a symbol, a digit, an uppercase letter) push people toward predictable substitutions such as Passw0rd!. The tool scores length first and keeps the symbol rule off by default. NIST's guidance on this is in SP 800-63B, section 5.1.1.
Leetspeak normalization is cheap and catches the obvious cases
Mapping @→a, 3→e, 0→o, $→s before the common-word check catches the most common substitutions. The OWASP Authentication Cheat Sheet recommends blocking common and context-specific passwords, which this check approximates on the client.
Crack-time numbers are assumptions, not measurements
The crack-time figure assumes 10 billion guesses per second, a fast offline hash, and an attacker who already has the hash. Slow, salted hashing such as bcrypt or Argon2 changes the real answer by orders of magnitude. The number shows relative strength between passwords and should not be read as a literal prediction.
Keep the password out of the page lifecycle
Nothing about the password is written to localStorage, and rule functions are pure. Only settings are persisted. Storage is the one place where a "100% client-side" claim can quietly break, so the tool keeps it out of there on purpose.