Work out bcrypt cost factor instantly with clear inputs, formula shown and shareable results.
bcrypt's cost factor is a base-2 exponent: cost 12 performs 4,096 key-setup rounds and takes twice as long as cost 11. Because the work doubles per increment, the practical ceiling is set by your login throughput — at 20 logins per second and 250 ms per hash, five CPU cores do nothing but verify passwords, which is also exactly the denial-of-service surface an attacker will probe.
bcrypt cost scaling
time = baseline x 2^(cost - 10); rounds = 2^cost; CPU cores = logins per second x time
Pick the highest cost that keeps verification under about 250 ms on your hardware. That is usually 12 or 13 on modern servers, and should be re-measured every few years.
The algorithm's key schedule only consumes 72 bytes of input. Longer passwords are silently truncated, so pre-hash with SHA-256 if you must accept long passphrases.