Why bcrypt is designed to be slow
Bcrypt was designed in 1999 specifically for password hashing. Its defining feature is the cost factor (also called work factor or rounds): a number between 4 and 31 that controls how many iterations the algorithm runs. At cost 10, a single bcrypt hash takes about 100ms on modern hardware. At cost 12, it takes about 400ms. This slowness is intentional.
A GPU can compute billions of SHA-256 hashes per second. The same GPU can compute roughly 10,000–100,000 bcrypt hashes per second at cost 10. If a database of bcrypt-hashed passwords is breached, the attacker's cracking speed is roughly 100,000× slower than against SHA-256. The extra 100ms per login that users don't notice protects them against a breach they don't know about.
Choosing the right cost factor
| Cost | Iterations | Approx. time (modern server) | Use case |
|---|---|---|---|
| 10 | 1,024 | ~100 ms | Standard web application login (OWASP minimum) |
| 11 | 2,048 | ~200 ms | Higher security, slightly more CPU cost |
| 12 | 4,096 | ~400 ms | High-value accounts, slow traffic sites |
| 13+ | 8,192+ | 800ms+ | Usually not worth the user-facing latency |
OWASP recommends cost 10 as the minimum. Increase it every few years as servers get faster — the goal is to keep hash time at roughly 100ms. This tool uses bcryptjs (MIT), a pure JavaScript implementation that runs entirely in the browser.
What bcrypt does not protect against
- 72-byte limitBcrypt truncates input at 72 bytes. Passwords longer than 72 characters produce the same hash as the 72-character prefix. For very long passphrases, pre-hash with SHA-256 before bcrypt if this matters.
- Null bytesSome bcrypt implementations stop at the first null byte. Avoid passwords that include null characters.
- Weak passwordsBcrypt slows down brute force but can't protect a password like "123456". It will still be cracked — just a bit slower. Password strength and hashing work together.

