Skip to content
FastUtil
Menu

How Long Does It Take to Crack a Password? The Math Behind Password Strength

By Sam Hartley · Published · Updated

"Use a strong password" is easy advice and hard to act on, because it never says how strong is strong enough. The strength of a randomly generated password comes down to arithmetic: how many possible passwords exist, and how fast an attacker can try them. This guide shows the numbers so you can judge for yourself.

The figures apply to passwords chosen randomly, like those from our password generator. Passwords that people invent, such as names, dates and common words, are far weaker than the math suggests, for reasons covered below.

Entropy: measuring strength in bits

Entropy counts the number of possible passwords as a power of two. A password with 40 bits of entropy has 2 to the power 40 possibilities, about a trillion. Every extra bit doubles the work for an attacker. For a random password the formula is simple: length multiplied by the base-2 logarithm of the character pool.

Character poolPool sizeBits per character
Lowercase letters264.7
Upper and lowercase525.7
Letters and digits625.95
All printable keyboard characters946.55

A bigger pool helps, but each extra character of length helps more than switching to a larger pool, which leads to the main lesson below.

Entropy by length and character type

This table shows the entropy in bits for random passwords of common lengths:

LengthLowercase (26)Mixed case (52)Letters and digits (62)All printable (94)
837.645.647.652.4
1047.057.059.565.5
1256.468.471.578.7
1675.291.295.3104.9
2094.0114.0119.1131.1

Notice that a 12-character lowercase-only password (56.4 bits) is stronger than an 8-character password using every keyboard character (52.4 bits). Length is the cheapest way to add strength.

How long would an attack take?

To turn bits into time you need an attacker's guess rate. The numbers below assume a fast offline attack of 10 billion guesses per second, which is plausible for a stolen database that stores passwords with a fast, unsalted hash and attackers with several modern graphics cards. On average an attacker finds the password after trying half the possibilities.

LengthLowercaseMixed caseLetters and digitsAll printable
810 seconds45 minutes3 hours4 days
102 hours84 days1 year85 years
1255 days620 years5,100 years750,000 years
1669,000 years4.5 billion years76 billion years59 trillion years
2032 billion years33 quadrillion years1.1 quintillion years4.6 sextillion years

Under this model an 8-character password falls in seconds to days, a 12-character mixed password holds for centuries, and anything of 16 random characters is beyond any realistic attack. These are estimates for a specific scenario, not guarantees. A faster attacker shortens every figure, and a site that stores passwords with a deliberately slow hash such as bcrypt or Argon2 lengthens them enormously, because it cuts the guess rate by many orders of magnitude.

Why human-chosen passwords are much weaker

The tables assume every character is picked at random. People do not do that. A password like Summer2026! looks like 11 characters from the full keyboard, but attackers try dictionary words, common substitutions, years and trailing symbols first, so it falls to a short, well-ordered guess list. The effective strength of a human-chosen password can be far lower than its length and character mix suggest.

Reused passwords are even worse. If a password leaks from one site, attackers try it on others straight away, so its entropy is irrelevant. Use a different password for every account.

Passphrases: strength you can remember

A passphrase chosen by picking random words from a list is easier to remember and measures just as well. A list of 7,776 words, the size used by the Diceware method, gives about 12.9 bits per word:

Random wordsEntropy
4 words51.7 bits
5 words64.6 bits
6 words77.5 bits

Six random words (77.5 bits) are about as strong as 12 random keyboard characters (78.7 bits), and far easier to remember. The words must be chosen randomly, for example with dice. A phrase you make up yourself, or a famous quotation, does not count.

What to do in practice

  • Use a password manager and let it generate a unique random password of 16 characters or more for each account.
  • For the few passwords you must remember, such as the manager's master password, use a random passphrase of at least five or six words.
  • Turn on two-factor authentication wherever it is offered, because it protects you even if a password leaks.
  • Check the length limits of the site. If a site caps passwords at a low length, use the longest allowed.
  • Generate passwords locally. Our password generator uses your browser's cryptographic random number generator, and nothing is sent or stored.

Same password, different attacker: how the guess rate changes the answer

The tables above assume a very fast offline attacker. Most real attacks are slower, because most sites limit how fast you can guess. The table below shows the average time to find five example passwords under four illustrative guess rates. The rates are round numbers chosen to show the spread, not measurements of any particular system.

Attacker8 lowercase8 letters and digits12 mixed case12 all printable6-word passphrase
Online, rate-limited (10 guesses per hour)1.2 million years1.3 billion years2.2 quadrillion years2.7 quintillion years1.3 quintillion years
Online, unthrottled (1,000 per second)3.3 years3,500 years6.2 billion years7.5 trillion years3.5 trillion years
Offline, slow hash (10,000 per second)121 days346 years620 million years754 billion years350 billion years
Offline, fast hash (10 billion per second)10 seconds3 hours619 years754,000 years350,000 years

Two things stand out. First, the same 8-character password goes from safe to broken depending on how the site stores it and whether it throttles guesses, which is something you cannot see or control. Second, once a password reaches 12 random characters, even the fastest scenario takes centuries, so the storage method stops mattering for practical purposes. That is why the advice is to choose a length that survives the worst case rather than hoping for the best one.

Do I need symbols?

Not for strength, if the password is long and random. The tables show that adding length helps more than widening the character pool. Some sites require a symbol anyway, so a generated password that includes one avoids the problem.

How often should I change a password?

Current guidance from NIST (Special Publication 800-63B) advises against forcing regular changes without a reason. Change a password when you have reason to think it has been exposed, such as a breach notice, and otherwise keep a long unique one.

Is a password manager safe?

A manager stores your passwords encrypted under a master password, so the risk moves to that one secret and to the device you use. Pick a long random passphrase for the master password and turn on two-factor authentication for the manager itself.

Is a longer password always better?

Against guessing, yes, as long as it is random. A long password built from a phrase you made up, or a pattern such as a word repeated, is weaker than its length suggests, because guessing tools try such patterns early.

Method and limits

Entropy was calculated as length times the base-2 logarithm of the pool size. Times are half of the total number of possibilities divided by 10 billion guesses per second, rounded for readability. The calculation assumes characters are chosen uniformly at random and independently. It says nothing about passwords that were chosen by a person, reused or leaked. The guess rate is an assumption for illustration, and real attackers and defences vary widely.

Quick summary

For a random password, length matters more than complexity: 12 random mixed-case characters would take centuries to guess at 10 billion tries per second, while 8 characters can fall in anywhere from minutes to days. Human-chosen passwords are far weaker than their length suggests.

Try it: Generate a strong password.

Related tools