Password Crack Time Calculator

An offline brute-force attack is arithmetic, not magic. The attacker searches a keyspace of CL candidates at a rate set by the hardware and divided by whatever work factor the password hash imposes, and on average finds the answer halfway through. Enter the password's length and alphabet, the raw hash rate of one accelerator, how many you assume the attacker has, and the KDF work factor, and this calculator returns the average and worst-case time, the effective guess rate, the entropy in bits, and the GPU-hours the attack costs. It also shows what one more character is worth.

Calculator

This calculator runs in your browser. Enable JavaScript for live results — the inputs, formula and worked example below remain fully readable without it.

Inputs this calculator takes, with typical values
InputWhat to enterExample
Password lengthNumber of characters the generator produces, counting every character in the password.12 chars
Lowercase letters (26)Tick if the generator could pick a to z at any position.Yes
Uppercase letters (26)Tick if the generator could pick A to Z at any position.Yes
Digits (10)Tick if the generator could pick 0 to 9 at any position.Yes
ASCII symbols (32)The 32 printable ASCII punctuation marks, excluding the space character.No
Raw hash rate per acceleratorRaw operations per second on the underlying primitive for one GPU, taken from a hashcat benchmark for the hash you are modelling. Switch to H/s to model a throttled online attack.10 GH/s
Accelerators in the attackHow many identical GPUs or ASICs the attacker runs in parallel; the rate scales linearly with this.1
Password hash / KDF work factorHow many primitive operations one guess costs. The effective guess rate is the raw rate divided by this number.Fast unsalted hash — MD5, SHA-1, SHA-256, NTLM (1x)
Custom work factor (overrides the list)Enter your own iteration count or slowdown factor; leave at 0 to use the option selected above.0
Custom alphabet size (overrides the tick boxes)Use for an alphabet the tick boxes do not describe — 16 for hex, or 7,776 to model a Diceware passphrase with length read as word count.0 symbols

It returns

  • Average time to crack — Expected time to find the password, searching half the keyspace. A year here is 365.25 days.
  • Average time, log₁₀ of years — Read as a power of ten: 5.88 means about 10^5.88 years. Stays readable when the time itself does not.
  • Average time in seconds
  • Password entropy
  • Effective guess rate
  • One more character multiplies the time by
  • Cost of the attack

The formula

t=CL2R
R=rrawgW
log10t=Llog10Clog102log10R

In plain text: t = C^L / (2 · R) where R = raw rate × accelerators / work factor

  • tAverage time to find the password by exhaustive search (s)
  • CAlphabet size — symbols available at each position (symbols)
  • LPassword length (characters)
  • REffective guesses per second after the KDF work factor is applied (1/s)
  • WWork factor — primitive operations consumed per guess (count)

The factor of two is the expected position of the target in a uniformly random search order; the worst case is twice this figure. The model assumes a uniformly random password and an attacker who gains nothing from structure.

Updated Category Security, Cryptography & Risk Verified against published test cases Reading time 13 min

What an offline brute-force attack actually costs

An offline attack starts when a database of password hashes leaks. From that point the attacker is no longer talking to your server, so rate limits, account lockout and monitoring are all irrelevant: they generate candidate passwords locally, hash each one, and compare. The only things that matter are how many candidates exist, how fast the hardware can hash, and how expensive one hash is.

The candidate count is the keyspace, CL for a uniformly random password of length L over an alphabet of C symbols. The attacker does not have to search all of it — on average the target sits halfway through a random search order, so expected work is half the keyspace and the worst case is the whole thing. That factor of two is the only probabilistic content in the model; everything else is division.

The rate has two parts, and separating them is what makes this calculator honest. The raw rate is how many times per second one GPU can evaluate the underlying primitive — a single SHA-256 compression, say. The work factor is how many of those primitive operations one password guess consumes: 1 for an unsalted single-round hash, 600,000 for PBKDF2-HMAC-SHA256 at the iteration count OWASP currently recommends. Effective guess rate is the raw rate times the number of accelerators, divided by the work factor. Nothing else in password storage moves the number this far.

Entropy is the other half of the story and is computed the same way here as on the password entropy calculator. Bits tell you the size of the search; this page converts that into wall-clock time and GPU-hours.

The formula, and why logarithms do the work

Written directly, average time t = CL ÷ (2R). The trouble is that CL overflows any calculator once the password gets past about twenty characters: 9420 is 2.9 × 1039, and 94128 has 253 digits. So work in logarithms, which is also how any practitioner would do it on paper.

Take log base ten of both sides: log10t = L · log10C − log102 − log10R. Every term is small and readable. Multiply the length by the digits-per-character figure, subtract 0.301 for the halving, subtract the exponent of the guess rate, and the answer is the exponent of the time in seconds. Subtract a further 7.499 — that is log10 of 31,557,600 seconds in a Julian year — to get years.

Two structural facts fall out of that expression. First, each extra character adds log10C to the exponent, which means it multiplies the time by C. One more character on a 94-symbol password is a 94-fold increase; one more on a lowercase password is a 26-fold increase. Second, a change in the work factor and a change in the hardware are interchangeable: moving from one GPU to a thousand is exactly cancelled by moving from a raw hash to PBKDF2 at 1,000 iterations. Defender and attacker are pulling on the same lever from opposite ends, and the defender's end is cheap.

The model deliberately gives the attacker every advantage. It assumes perfect linear scaling across accelerators, no candidate-generation overhead, no memory bandwidth limit, and no time spent on anything but hashing. Real attacks fall short of that, so the times here are floors.

Worked example: twelve mixed-case alphanumeric characters

Take a randomly generated twelve-character password using lowercase, uppercase and digits, stored as an unsalted fast hash, attacked by a single GPU benchmarking at 10 GH/s on that hash.

  1. Alphabet. 26 + 26 + 10 = C = 62.
  2. Entropy. log262 = 5.9542 bits per character, so 12 × 5.9542 = 71.45 bits.
  3. Keyspace. 6212. Squaring your way up: 622 = 3,844; 624 = 14,776,336; 628 = 2.1834 × 1014; 6212 = 628 × 624 = 3.2263 × 1021.
  4. Halve it. Average candidates tried = 1.6131 × 1021.
  5. Divide by the rate. Work factor 1, one GPU, so R = 1010 guesses per second. 1.6131 × 1021 ÷ 1010 = 1.6131 × 1011 seconds.
  6. Convert to years. ÷ 31,557,600 = 5,112 years on average, 10,224 years worst case.
  7. Price the attack. 1.6131 × 1011 s ÷ 3,600 = 4.48 × 107 GPU-hours. At even a few cents an hour of rented compute that is millions of dollars, which is the number that actually decides whether an attack happens.
  8. Now change the storage. Move the same password behind PBKDF2-HMAC-SHA256 at 600,000 iterations. R falls to 1010 ÷ 600,000 = 16,667 guesses per second, and the average time becomes 5,112 × 600,000 = 3.07 × 109 years.
  9. Or change the password. Keep the fast hash and add two characters: 5,112 × 62 × 62 = 1.96 × 107 years.

Steps 8 and 9 are the whole security argument in two lines. The storage decision, made once by an engineer, bought a factor of 600,000. Two characters, asked of every user forever, bought a factor of 3,844.

How to read the answer without fooling yourself

Read the exponent, not the digits. A result of 7.5 × 104 years and one of 8.1 × 104 years are the same answer; a result of 104 and one of 109 are different answers. The inputs carry at best one significant figure of confidence — nobody knows the attacker's hardware — so anything that survives a factor-of-ten error in the rate is a robust conclusion, and anything that does not is a coin flip.

Set your bar against the useful life of the secret, not against eternity. A password protecting data that stops mattering in five years needs to survive five years of attack, not a million. That reframing is what makes the numbers actionable: a figure above about 103 years is beyond any realistic campaign against one account, a figure in hours or days means the password is already gone, and the interesting decisions live in between.

Then apply the correction the model cannot make. Everything on this page assumes a uniformly random password. Real attackers do not brute force; they run wordlists, previous breach corpora and rule sets that mutate them, and they crack the great majority of human-chosen passwords in a real dump long before an exhaustive search would reach them. If the password was invented rather than generated, the honest reading of this page is that the answer is an upper bound with no lower bound at all.

Finally, notice what the model refuses to reward. Adding symbol characters moves C from 62 to 94, a factor of 1.5 per character. Adding one character multiplies by 62. Switching the hash multiplies by up to a million. Composition rules are the weakest of the three levers, and NIST SP 800-63B advises against them for exactly that reason — a point developed further in the password entropy calculator.

Average crack time by length and storage scheme

Random passwords over a 62-symbol mixed-case alphanumeric alphabet, attacked at a raw rate of 10¹⁰ hashes per second. The fast-hash column applies a work factor of 1; the PBKDF2 column applies 600,000, giving an effective 16,667 guesses per second. Times are averages, half the keyspace; double them for the worst case.
LengthEntropyKeyspaceFast unsalted hashPBKDF2, 600,000 iterations
635.7 bits5.68 × 10¹⁰2.8 seconds20 days
847.6 bits2.18 × 10¹⁴3.0 hours208 years
1059.5 bits8.39 × 10¹⁷1.3 years7.98 × 10⁵ years
1271.5 bits3.23 × 10²¹5,112 years3.07 × 10⁹ years
1483.4 bits1.24 × 10²⁵1.96 × 10⁷ years1.18 × 10¹³ years
1695.3 bits4.77 × 10²⁸7.55 × 10¹⁰ years4.53 × 10¹⁶ years

The two columns differ by a constant factor of 600,000 at every length, because the work factor divides the rate and nothing else. That constant is a storage decision, not a password decision.

Where the work factors come from

The bcrypt options come from the algorithm's own definition: the cost parameter is an exponent, so cost 10 runs 210 = 1,024 iterations of the key schedule and cost 12 runs 4,096. The PBKDF2 options are the iteration counts in the OWASP Password Storage Cheat Sheet — 600,000 for PBKDF2-HMAC-SHA256 and 210,000 for PBKDF2-HMAC-SHA512. Treating those iteration counts as a straight divisor on the guess rate is exact for PBKDF2, whose cost really is a repeated hash. It is conservative for bcrypt, scrypt and Argon2, because those algorithms also consume memory and defeat the massive parallelism that makes GPUs fast, so measured GPU throughput against them falls further than the iteration count alone predicts. Argon2id, defined in RFC 9106, is parameterised by memory as well as time, and the memory parameter is the one this simple model cannot represent.

Assumptions and limits worth stating out loud

  • It assumes a uniformly random password. Anything a person invented is found by dictionary and rule-based attacks that never touch the full keyspace.
  • It assumes the attacker knows the length and alphabet. If they must also search shorter lengths the total is only about C/(C−1) times larger, so the secrecy of your policy is worth almost nothing.
  • It assumes perfect parallel scaling. Real clusters lose throughput to candidate generation, PCIe bandwidth and thermal limits, so the times shown are floors.
  • It assumes one hash rate for the whole campaign. Hardware improves; a figure that looks safe for a decade at today's rates may not be at the end of it.
  • It ignores salts, and that is correct. A unique salt stops one search covering many accounts, but it does not slow a targeted search of one account at all. Only the work factor does that.
  • It ignores everything except guessing. Phishing, credential stuffing, keyloggers and password reuse are unaffected by any number on this page.
  • It reports averages. The worst case is twice the figure shown, and an unlucky defender can be found in the first minute of a search that averages centuries.

Related calculations and what to do with the answer

If you are choosing a password policy, run this page backwards. Fix the storage scheme first, because it sets the work factor and therefore the guess rate. Decide how long the secret must hold — the life of the data, not eternity. Then read off the length that clears that horizon with a factor of a thousand to spare, so a surprise in the attacker's hardware does not invalidate the decision.

If you are writing a pentest report, quote three numbers rather than one: the effective guess rate you assumed, the entropy of the password class, and the resulting GPU-hours. GPU-hours convert directly into rented-compute cost, and a cost figure is the only form of this result that a risk register can consume — feed it into an exposure model such as the annualised loss expectancy calculator, or alongside a severity rating from the CVSS base score calculator.

For raw cryptographic keys rather than passwords, the work factor disappears and the arithmetic simplifies to keyspace over rate, which is the case handled by the brute-force key search time calculator. And when the question is a collision rather than a preimage — two inputs sharing a hash, not one input matching a target — the birthday bound halves the effective bit strength and the numbers change completely; that is the hash collision probability calculator.

One last framing that survives every uncertainty in the inputs. A password with 60 bits of entropy behind Argon2 is stronger in practice than one with 80 bits behind unsalted MD5, because the storage decision moves the guess rate by more orders of magnitude than any plausible password policy moves the keyspace. If you can change only one thing, change the hash.

Key terms

Offline attack
Guessing against a stolen hash on the attacker's own hardware, where rate limits and lockouts do not apply.
Work factor
Primitive operations consumed per password guess. It divides the attacker's raw hash rate and is the defender's strongest lever.
Salt
A unique per-password value mixed into the hash. It prevents precomputation and shared work across accounts, but does not slow a targeted attack on one password.
Rule-based attack
A wordlist plus transformation rules — capitalise, append digits, substitute characters — that reproduces the patterns people use, and finds most human-chosen passwords far faster than exhaustive search.
GPU-hour
One accelerator running for one hour. The natural cost unit for an attack, because it converts directly into a rental price.

Frequently asked questions

How long does it take to crack a 12-character password?

It depends entirely on the alphabet and the storage scheme, which is why there is no single answer. A random 12-character mixed-case alphanumeric password behind an unsalted fast hash attacked at 10¹⁰ guesses per second averages about 5,100 years. The same password behind PBKDF2 at 600,000 iterations averages 3 × 10⁹ years. A human-chosen 12-character password with a dictionary stem can fall in minutes.

What guess rate should I enter?

Use a published hashcat benchmark for the specific hash and the GPU you want to model, and enter it as the raw rate with a work factor of 1 if the benchmark is already for the full KDF. Rates for unsalted hashes on a current high-end consumer GPU sit in the tens of gigahashes per second; rates for bcrypt at cost 12 on the same card sit in the low thousands. The result is only as good as this input, so vary it by a factor of ten and see whether your conclusion survives.

Does a salt make my password harder to crack?

Not for a targeted attack on one password, which is what this page models. A unique salt stops rainbow tables and stops one search covering every account in the dump at once, so it is essential — but the attacker aiming at your specific hash still gets the same guesses per second. Only the work factor slows that down, which is why salting and a slow KDF are two separate requirements rather than alternatives.

Why is bcrypt so much slower to attack than SHA-256?

Because it is designed to be, and because it fights GPUs specifically. Its cost parameter is an exponent, so cost 12 runs 4,096 iterations of the Blowfish key schedule, and that schedule needs about 4 KB of rapidly-changing state per instance. GPUs get their speed from thousands of tiny cores with very little fast memory each, so they cannot keep thousands of bcrypt instances resident. This calculator counts only the iterations, so it understates bcrypt's real advantage.

Is an online attack ever a realistic threat?

Only against weak or reused passwords, because the rate is thousands of times lower. Set the raw rate to a handful of guesses per second in H/s with a work factor of 1 to model a throttled login endpoint: at five guesses per second a random six-character lowercase password still averages about a year, and a ten-character one averages hundreds of thousands of years. Online guessing is defeated by rate limiting and lockout; the passwords that fall online fall because they appear in a breach corpus, not because the keyspace was searched.

Why does the calculator halve the keyspace?

Because the expected position of a uniformly random target in a random search order is the middle. The attacker stops the moment they hit the right candidate, so the average work is half the keyspace and the worst case is all of it. Doubling the figure shown gives the worst case, and that factor of two is small enough to ignore next to the uncertainty in the guess rate.

Should I add symbols or add length?

Add length; the arithmetic is not close. Each extra character multiplies the time by the alphabet size, so one more character on a 62-symbol password multiplies by 62. Adding the 32 ASCII symbols to a 12-character password raises the alphabet from 62 to 94, which multiplies the total by (94/62)¹² ≈ 147 — far less than the 3,844 that two extra characters would give, and it makes the password harder to type on every keyboard layout you do not control.

Does this account for quantum computers?

No, and the correction is smaller than people expect for passwords. Grover's algorithm searches an unstructured keyspace in about the square root of the classical number of steps, which would halve the effective bits — but it is inherently sequential, resists the parallel speed-up that makes GPU cracking cheap, and needs a fault-tolerant machine that does not exist. The practical threat to passwords remains a cluster of GPUs running a rule-based attack.

References