BcryptGenerator.org
By Shahzeb Zafar··Updated ·7 min read

How Many Bcrypt Rounds Should You Use in 2026?

Use 12 bcrypt rounds (salt rounds, cost or BCRYPT_ROUNDS) for new apps. Measured timings for 10–14, a benchmark script and code to upgrade old hashes.

bcryptsecurityperformanceowasp

The short answer

Use a cost of 12 for new systems in 2026, and go higher if your server can afford it. OWASP's minimum is 10. When PHP raised its own default from 10 to 12 in PHP 8.4, the measurements behind that decision showed cost 12 taking between about 160 and 330 milliseconds per hash on a range of CPUs. That's a delay users won't notice at login.

What "rounds" and "salt rounds" actually mean

The number you pass to bcrypt goes by several names: rounds, salt rounds, cost, cost factor, work factor, or BCRYPT_ROUNDS in Laravel. They all mean the same thing, and the name "salt rounds" is misleading. The number has nothing to do with the salt; every hash still gets one random salt.

It's an exponent. A cost of N makes bcrypt repeat its expensive key setup 2^N times, so each step up doubles the work:

CostKey-setup roundsRelative work
101,0241×
112,0482×
124,0964×
138,1928×
1416,38416×

The doubling applies to attackers too. Moving from cost 10 to cost 12 makes every guess against a stolen hash four times as expensive.

What OWASP recommends

The OWASP Password Storage Cheat Sheet sets a bcrypt work factor of 10 or more, together with a 72-byte password limit. It also recommends Argon2id first for new systems, and bcrypt where Argon2id isn't available. See bcrypt vs Argon2 for that comparison.

Treat 10 as a floor, not a target. Pick the highest cost your hardware handles comfortably.

How long does each cost take?

These measurements come from the PHP project's RFC that raised PHP's default bcrypt cost to 12, measured with PHP 8.2 on mains power. Times are per hash:

CPUCost 10Cost 11Cost 12Cost 13Cost 14
Intel Xeon E-2246G (2019)40 ms79 ms159 ms316 ms632 ms
AMD EPYC 7002 (2019)59 ms116 ms244 ms485 ms997 ms
Apple M1 Pro (2021)61 ms121 ms240 ms481 ms966 ms
Intel Xeon E31245 (2011)64 ms128 ms256 ms523 ms1,048 ms
Intel Core i5-2430M (2011 laptop)81 ms162 ms328 ms657 ms1,319 ms

The RFC's conclusion: cost 12 is "well below 0.5 seconds on all tested CPUs".

Your numbers will differ with the language, the library and the hardware. A pure-JavaScript library like bcryptjs is noticeably slower than a native one, and laptops vary a lot between runs as the CPU changes power state. On the laptop used to test this article, the same cost-12 hash took anywhere from about 0.35 to 1 second across runs. That's why the next step matters.

Benchmark your own server

Run this on your production hardware, or the closest thing to it. It takes the median of five runs per cost, so one slow run doesn't skew the result:

const bcrypt = require('bcryptjs') // or require('bcrypt')

async function benchmark() {
  for (let cost = 10; cost <= 14; cost++) {
    const times = []
    for (let i = 0; i < 5; i++) {
      const start = process.hrtime.bigint()
      await bcrypt.hash('benchmark-password', cost)
      times.push(Number(process.hrtime.bigint() - start) / 1e6)
    }
    times.sort((a, b) => a - b)
    console.log(`Cost ${cost}: ${Math.round(times[2])} ms (median of 5)`)
  }
}

benchmark()

A practical rule: choose the highest cost that keeps a single hash comfortably under a quarter to half a second on your login servers. Remember that hashing uses CPU, so several people logging in at once multiplies the load.

How the cost slows down attackers

After a database breach, an attacker's only option is guessing: hash a candidate password with the stored salt and cost, compare, repeat. The cost sets the price of every guess.

For a sense of scale: in October 2022, security researcher Sam Croley reported an overclocked RTX 4090 running hashcat's benchmark at about 200,000 bcrypt hashes per second, against about 300 billion per second for NTLM, a fast hash (TechSpot). Each extra cost step halves that bcrypt rate again.

The cost works together with password strength. An 8-character password using upper- and lowercase letters and digits has 62⁸ ≈ 218 trillion possibilities. Twelve characters gives 62¹² ≈ 3.2 × 10²¹, more than ten million times as many. A higher cost buys time, but long, unique passwords are what make a stolen hash practically useless to an attacker. Weak passwords like password123 fall quickly no matter what the cost is, because attackers try them first.

Common mistakes

Using test-suite costs in production. Costs of 4–6 are fine in automated tests, where you want speed, but they should never reach production. Make the cost come from configuration:

const BCRYPT_ROUNDS = parseInt(process.env.BCRYPT_ROUNDS ?? '12', 10)
const hash = await bcrypt.hash(password, BCRYPT_ROUNDS)

Never upgrading old hashes. Raising the setting only affects new hashes. Existing users keep their old, lower cost until you re-hash. The usual approach is to upgrade at login, the one moment you have the plain password:

async function login(user, password) {
  const valid = await bcrypt.compare(password, user.passwordHash)
  if (!valid) return false

  // Upgrade hashes created with an older, lower cost
  if (bcrypt.getRounds(user.passwordHash) < BCRYPT_ROUNDS) {
    user.passwordHash = await bcrypt.hash(password, BCRYPT_ROUNDS)
    await saveUser(user)
  }
  return true
}

PHP has this built in as password_needs_rehash(), covered in our PHP guide.

Thinking the cost must match when you verify. It doesn't. compare() reads the cost from the stored hash, so hashes with different costs verify side by side. For the mistakes that do break verification, see why bcrypt.compare() returns false.

Going so high that logins become a target. Bcrypt is CPU-heavy by design. A cost that takes several seconds per hash can let someone overload your server just by sending login requests, so rate-limit your login endpoint whatever cost you choose.

Choosing a cost by situation

SituationSuggested costWhy
Automated tests4Speed; never in production
Typical web app12Comfortably above OWASP's minimum; well under half a second on modern CPUs
Sensitive data (finance, health, admin accounts)13–14, if your benchmark allowsEach step doubles attacker cost; check the login latency
Very high login volumeThe highest that holds up under peak loadHashing cost multiplies with concurrent logins

Conclusion

Start at 12, benchmark on your own servers, re-hash old passwords at login, and revisit the number every year or two as hardware gets faster. Use the bcrypt generator to see hashes at different costs, and the bcrypt checker to read the cost of any existing hash.