Bcrypt vs Argon2 vs scrypt: Choosing a Password Hash in 2026

All three are correct answers. Here is how they differ, what parameters to use, and how to migrate from whatever you have now.

What they have in common

All three are password hashing functions, sometimes called key derivation functions. Unlike SHA-256 they are designed to be expensive to compute, with a tunable cost so they can be made more expensive as hardware improves. All three salt automatically and encode algorithm, parameters and salt into the output string, so verification needs nothing but the stored string and the candidate password. If your system uses any of them with sensible parameters, you are in the top tier and can stop reading. If it uses MD5, SHA-1, SHA-256 or “SHA-256 with a salt” for passwords, keep going.

Bcrypt (1999)

Built by Niels Provos and David Mazières on the Blowfish cipher. Its cost parameter is a power of two: cost 12 means 4,096 rounds of key setup. Doubling is easy to reason about and easy to raise over time.

  • Strengths: 27 years of scrutiny, an implementation in every language, and a work factor that has aged well because Blowfish’s 4 KB internal state fits badly on GPUs.
  • Weaknesses: only the first 72 bytes of the password are used, and it is CPU-bound rather than memory-bound, so custom hardware helps attackers somewhat more than it does with Argon2.
  • Recommended: cost 12 in 2026 (roughly 250 ms on a server core), never below 10. Pre-hash with SHA-512 and Base64 if you need to support passphrases over 72 bytes.

Generate and verify examples on the bcrypt tool; the timing readout shows what each cost level actually costs.

scrypt (2009)

Colin Percival designed scrypt to be memory-hard: computing it requires a large scratch buffer, so an attacker cannot simply build thousands of tiny hashing cores on a chip. Parameters are N (memory/CPU cost, e.g. 2¹⁷), r (block size, 8) and p (parallelism, 1).

  • Strengths: strong GPU and ASIC resistance for its era; used by several cryptocurrencies, so its hardware behaviour is well understood.
  • Weaknesses: parameters are less intuitive, memory and time are tied together (you cannot raise one without the other), and library support is thinner than bcrypt’s.
  • Recommended: N=2¹⁷ (128 MiB), r=8, p=1 where memory allows; N=2¹⁶ otherwise.

Argon2 (2015)

Winner of the Password Hashing Competition. Three variants: Argon2d (maximum GPU resistance, side-channel-vulnerable), Argon2i (side-channel-resistant, weaker against GPUs) and Argon2id, the hybrid everyone should use. Memory, iterations and parallelism are separate parameters, so you can fit it to your hardware precisely.

  • Strengths: best available resistance to GPUs and ASICs, independent tuning of memory and time, active standardisation (RFC 9106), OWASP’s first recommendation.
  • Weaknesses: younger than bcrypt, and the memory requirement can be awkward in serverless or heavily shared environments.
  • Recommended (OWASP 2024): Argon2id with 19 MiB memory, 2 iterations, 1 degree of parallelism as the minimum; 64 MiB and 3 iterations if you can afford it.

Side by side

bcrypt scrypt Argon2id
Year 1999 2009 2015
Memory-hard No (4 KB) Yes Yes
GPU speed vs CPU ~5× ~2× ~1×
Guesses/s, 8 GPUs, recommended params ~10,000 ~2,000 ~1,000
Max password length 72 bytes unlimited unlimited
Library support Universal Good Good and growing
Output prefix $2b$ $7$ or $scrypt$ $argon2id$

Paste any stored hash into the hash identifier to see which one a system uses.

Choosing

  • New system, you control the servers: Argon2id, 64 MiB, 3 iterations.
  • New system, constrained memory or framework defaults: bcrypt cost 12. It is not a compromise; it is fine.
  • Existing bcrypt system: stay, raise the cost when it drops below 200 ms.
  • Existing scrypt system: stay unless you have a reason to move.
  • Anything SHA- or MD5-based: migrate now.

Migrating without a password reset

You cannot convert an existing hash to a new algorithm because you do not have the password. You can, however, rehash at login:

  1. Add the new algorithm alongside the old one.
  2. On each successful login, if the stored hash uses the old algorithm, compute the new hash from the password the user just typed and replace the stored value.
  3. After a few months, force a reset for the accounts that never logged in, or wrap the old hashes: store argon2id(old_hash) so the leak-resistance improves immediately, and unwrap on the user’s next login.

The crack time calculator shows what the migration buys: switch the scenario from “Offline, SHA-256” to “Offline, bcrypt” and watch hours become millennia.

New tools and guides, about once a month.

No tracking pixels, no upsells. Unsubscribe with one click.

Newsletter