Bcrypt Cost Factor Estimator

Find the right bcrypt work factor for your hardware to hit a target hash time.

Parameters

50 ms OWASP min: 100 ms 2000 ms

Shows CPU core-seconds consumed per second at peak.

Recommendation

Recommended Cost
Est. Hash Time
ms

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.

Copied!

Summary

Find the right bcrypt work factor for your hardware to hit a target hash time.

How it works

  1. Select your target hash time in milliseconds (OWASP minimum: 100ms).
  2. Choose your server hardware tier to apply a timing multiplier.
  3. The tool calculates which cost factor hits your target using the doubling formula: t(cost) = t_base × 2^(cost − base_cost).
  4. Optionally enter peak logins per second to see CPU overhead.
  5. 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.

Frequently Asked Questions

Last updated: 2026-07-01 · Reviewed by Nham Vu