Security

Password Strength Checker: How It Works and What to Trust

A password strength checker estimates how many guesses an attacker would need, mostly by looking for patterns an attacker would try first: common passwords, dictionary words, names, dates, repeats and keyboard runs. The better ones also compare your password with lists of leaked passwords, because length and symbols alone are a poor measure.

This page explains what happens between typing a password and seeing "weak" or "strong", how to read the result, and when a checker is the wrong tool.

The three kinds of password strength checker

Almost every checker you will find online is one of these, or a mix of them.

TypeWhat it looks atMain weakness
Rule-based (LUDS)Count of lowercase letters, uppercase letters, digits and symbols, plus lengthRates predictable passwords as strong if they tick the boxes
Pattern-based (for example zxcvbn)Matches against common passwords, words, names, dates, sequences and keyboard patterns, then estimates guessesOnly as good as its word lists and patterns
Breach-basedLooks the password up in a list of passwords that have leakedSays nothing about a password that has not leaked yet

The rule-based type is the oldest. The zxcvbn paper presented at USENIX Security 2016 describes it as an alternative to LUDS, which the author calls "a conclusively burdensome and ineffective security practice." It is still what you get when a sign-up form shows a coloured bar that turns green once you add a capital letter and a digit.

Why length and symbols are not enough

A simple checker applies the entropy formula, length × log2(pool size), to whatever you typed. For Password1! that gives 10 × log2(94) = 10 × 6.55 = 65.5 bits, which looks respectable. The formula assumes each character was chosen at random. Here it was not: it is a common word, capitalised, with a digit and a symbol added at the end, which is exactly what people do when a form demands them. The full explanation of the formula and its limits is in Password Entropy Explained.

A checker that knows about that pattern gives the password a low guess count instead, because an attacker working through common passwords with typical substitutions reaches it early. That is the core idea behind the pattern-based approach.

How a pattern-based checker (zxcvbn) works

zxcvbn was written at Dropbox and is open source. Its README says it uses "pattern matching and conservative estimation" and lists what it looks for:

  • Common passwords (the README cites about 30,000).
  • Common names and surnames, from US census data.
  • English words, from Wikipedia and US TV and movie subtitles.
  • Dates, repeats such as aaa, and sequences such as abcd.
  • Keyboard patterns such as qwertyuiop, and l33t-speak substitutions.

The tool splits your password into pieces that match these patterns, estimates how many guesses each piece would take, and combines them into one guess count. The README exposes that as guesses and guesses_log10. It also returns crack_times_seconds and crack_times_display for four scenarios: online with throttling, online without throttling, offline with a slow hash, and offline with a fast hash. A sequence field shows which patterns the estimate relied on, and a feedback field carries a warning and suggestions when the score is 2 or lower. You can pass user_inputs, such as your name or email address, so that passwords containing them are penalised.

The published abstract says the estimator is "accurate and conservative at low magnitudes, suitable for mitigating online attacks", that the data it needs fits in 1.5 MB of compressed storage, and that it "runs in milliseconds". That is why it runs in a web page on every keystroke without a server.

What the zxcvbn score 0 to 4 means

The score is a coarse bucket of the guess count. These are the thresholds from the README:

ScoreEstimated guessesREADME description
0below 103Too guessable, risky
1below 106Very guessable, protects against throttled online attacks
2below 108Somewhat guessable, protects against unthrottled online attacks
3below 1010Safely unguessable, moderate protection against offline slow-hash attacks
41010 or moreVery unguessable, strong protection against offline slow-hash attacks

Notice that the top score is a statement about slow-hash offline attacks. It is not a promise against an attacker with a stolen database of fast, unsalted hashes. How Long to Crack a Password shows how much the guess rate changes the answer.

Checking against leaked passwords

NIST SP 800-63B-4 does not ask for a strength score at all. It asks services to compare a new password against a blocklist: verifiers must "compare the prospective secret against a blocklist that contains known commonly used, expected, or compromised passwords." The comparison applies to the whole password, not to "substrings or words that might be contained therein", and a blocked password means the user must choose a different one.

The OWASP Authentication Cheat Sheet describes the same idea with a named service. Pwned Passwords is "a service where passwords can be checked against previously breached passwords", usable through its API or as a downloaded database you host yourself. OWASP also recommends a password strength meter and names the zxcvbn-ts library for it, while advising you to check the age and maturity of other-language ports before use.

The two checks answer different questions. A meter asks "would this be easy to guess from patterns?". A blocklist asks "has someone already used this exact password?". A random-looking string that happens to be in a breach list fails the second even if it passes the first.

What NIST says about length and composition

The same NIST document sets the rules that a good checker should reflect:

  • Passwords used as a single authentication factor must be at least 15 characters. If the password is only one part of multi-factor authentication, the minimum is 8.
  • Services "SHALL NOT impose other composition rules (e.g., requiring mixtures of different character types)."
  • Services must offer guidance that helps people choose a strong password, which is the job a strength meter is meant to do.

In practice, a checker that insists on one capital, one digit and one symbol is enforcing a rule NIST tells services not to impose. A checker that rewards extra length and flags dictionary words is closer to the current guidance.

How to use a password strength checker safely

  1. Do not type your real password into a site you do not trust. You cannot tell from the page whether it sends keystrokes to a server. Test a password of the same style, or open the browser's developer tools, switch to the Network tab, type, and confirm that no request is sent.
  2. Prefer a checker that explains its result. A warning such as "this is a common password" or "keyboard patterns are easy to guess" tells you what to change. A bare green bar does not.
  3. Treat the score as a floor, not a certificate. It is an estimate of guessability. It cannot see reuse, phishing, or a site that stores passwords badly.
  4. Fix a weak result by changing the method, not by decorating the password. Adding ! or swapping a for @ is a pattern these tools already model.

What to do instead of tuning a password by hand

If the checker keeps telling you a password is weak, stop editing it and generate one. A randomly generated password of 15 or more characters has no pattern for the checker to find, and a password manager means you never need to remember it. How to Create a Strong Password covers the generator and dice-passphrase methods, and How Do Password Managers Work? explains where the generated password is stored. For a quick one-off, the larely password generator runs in your browser.

If you build a sign-up form yourself, the same sources suggest a combination: a pattern-based meter for feedback while the user types, a minimum length, no character-type rules, and a blocklist check on submit.

Limits of every password strength checker

All three types estimate how an attacker would guess, and none of them can know what the attacker actually knows. A password that is not in any list but is built from your pet's name and birth year may score well while being easy for someone who knows you. A checker also says nothing about where the password is used. The most effective extra protection is not a higher score, it is a unique password for each account and a second login factor on the accounts that matter.

Frequently asked questions

Is it safe to type my real password into a password strength checker?
Only if the checker runs entirely in your browser and sends nothing to a server. You cannot be sure from the page alone, so the safer habit is to test a password of the same style, not the real one, or to open the browser's Network tab while you type and confirm that no request is made.
Why does one checker call my password strong and another weak?
They use different methods. A simple checker counts length and character types. A pattern-based one such as zxcvbn searches for dictionary words, names, dates, repeats, sequences and keyboard runs, and a breach-based one looks the password up in a list of leaked passwords. The same string can pass the first and fail the other two.
Does a strong score mean my password is safe?
No. The score is an estimate of how hard the password is to guess. It cannot tell whether you reuse it on other sites, whether it was phished, or whether a site stores it badly. A unique password plus a second login factor covers those risks.
What does zxcvbn score 3 or 4 mean?
In the zxcvbn README, score 3 means estimated guesses of at least 10^8 and below 10^10, which gives moderate protection against offline slow-hash attacks. Score 4 means 10^10 guesses or more, which gives strong protection against the same attacks.

Sources