Minimum Password Length Calculator
Find the shortest password that reaches a target entropy in bits, or that survives a target number of years of attack.
About Minimum Password Length Calculator
Each character contributes log2(charset) bits, so dividing the target by that and rounding up gives the shortest compliant password. The time-based route works backwards from the attack: surviving Y years at R guesses per second means the keyspace must exceed 2 × R × Y × seconds-per-year, and taking log2 converts that keyspace into bits. It replaces the arbitrary '8 characters minimum' with a number derived from the hash you actually use — against bcrypt a 10-character password is fine, against unsalted MD5 it is not.
Formula
Minimum Password Length
length = ceiling(target bits ÷ log2(charset size)); for a time target, bits needed = log2(2 × rate × years × 31,536,000).
- 31536000
- Seconds in a 365-day year
- target bits
- Entropy the policy demands
- rate
- Attacker guesses per second
Worked example
With the default values below, Minimum Password Length Calculator returns Recommended Minimum Length of 13. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Target entropyaccepts 8–512 bits
- 80 bits
- Character set availableone of Digits only (10), Lowercase letters (26), Mixed-case letters (52), Alphanumeric (62), Printable ASCII (95)
- Printable ASCII (95)
- Attacker's hash rateone of MD5 — 100 G/s, SHA-256 — 10 G/s, bcrypt cost 12 — 30 k/s, Argon2id 64 MiB — 5 k/s
- SHA-256 — 10 G/s
- Years the password must surviveaccepts 0.01–1,000,000 years
- 100 years
Results
- Recommended Minimum Length
- 13 characters
- Length for the Entropy Target
- 13 characters
- Length for the Time Target
- 11 characters
- Entropy at Recommended Length
- 85.4 bits
- Bits Needed for the Time Target
- 65.8 bits
Step by step
- 1Values used
- 2Minimum Password Length
- 3Recommended Minimum Length= 13 characters
- 4Length for the Entropy Target= 13 characters
- 5Length for the Time Target= 11 characters
- 6Entropy at Recommended Length= 85.4 bits
- 7Bits Needed for the Time Target= 65.8 bits
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is Minimum Password Length calculated?
length = ceiling(target bits ÷ log2(charset size)); for a time target, bits needed = log2(2 × rate × years × 31,536,000). Each character contributes log2(charset) bits, so dividing the target by that and rounding up gives the shortest compliant password. The time-based route works backwards from the attack: surviving Y years at R guesses per second means the keyspace must exceed 2 × R × Y × seconds-per-year, and taking log2 converts that keyspace into bits.
Why does Minimum Password Length matter?
It replaces the arbitrary '8 characters minimum' with a number derived from the hash you actually use — against bcrypt a 10-character password is fine, against unsalted MD5 it is not.
What values do I need to enter?
This calculator takes 4 inputs: Target entropy, Character set available, Attacker's hash rate, Years the password must survive. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
Why is the length for the time target sometimes shorter?
Because a slow hash does the work for you. Against Argon2id at 5000 guesses per second, surviving a century needs only about 45 bits — 7 characters. The entropy target then dominates, which is the right outcome: it protects you if the hash is ever downgraded or the attacker's hardware improves.
Should I plan for future hardware?
Yes. GPU cracking throughput has historically risen roughly an order of magnitude per decade, which is about 3.3 bits. Adding 10 bits to the target covers roughly 30 years of hardware progress; one extra character of printable ASCII buys 6.6 of them.
Related Calculators
- Password Entropy Score Calculator
- Password Crack Time Calculator
- Password Complexity Calculator
- Authentication Health Score Calculator
- MFA Security Calculator
- Password Expiry Calculator
- Password Hygiene Score Calculator
- Password Manager Coverage Calculator
- Password Reuse Risk Calculator
- Password Rotation Calculator
You might also need
- Password Entropy Score CalculatorCommonly used together
- Password Crack Time CalculatorCommonly used together
- Password Complexity CalculatorCommonly used together
- Authentication Health Score CalculatorAlso in Password Security
- MFA Security CalculatorAlso in Password Security
- Passphrase Strength CalculatorAlso in Password Security
