Bcrypt Cost Factor Estimator
Find the right bcrypt work factor for your hardware to hit a target hash time.
Parameters
Shows CPU core-seconds consumed per second at peak.
Recommendation
Cost Factor Comparison
| Cost | Iterations | Est. Time (ms) | Status |
|---|---|---|---|
| Enter parameters and click Calculate | |||
Code Examples
// Click Calculate to generate code
Why Cost Factor Matters
Bcrypt's work factor is an exponential dial: increasing cost by 1 doubles the time an attacker needs to brute-force each password hash. At cost 10 an attacker with a GPU can try ~100,000 hashes/second; at cost 14 that drops to ~6,000. OWASP recommends at least 100ms per hash on your production hardware, re-evaluated as hardware improves. Never store plain-text passwords or use fast hashes (MD5, SHA-1, SHA-256) for passwords — they offer no resistance to GPU cracking.
Summary
Find the right bcrypt work factor for your hardware to hit a target hash time.
How it works
- Select your target hash time in milliseconds (OWASP minimum: 100ms).
- Choose your server hardware tier to apply a timing multiplier.
- The tool calculates which cost factor hits your target using the doubling formula: t(cost) = t_base × 2^(cost − base_cost).
- Optionally enter peak logins per second to see CPU overhead.
- Copy the generated code snippet for PHP, Python, or Node.js.
Use cases
- Choose a bcrypt cost factor before deploying a new authentication system.
- Re-tune cost after migrating to faster or slower server hardware.
- Check whether your current cost factor meets OWASP recommendations.
- Estimate CPU impact of bcrypt at peak login traffic.