Guides

Argon2 vs bcrypt: Which Password Hash to Use?

Dr. Anika RhodesΒ·Β·7 min read

Here's the claim that gets me quietly disinvited from architecture reviews: for a brand-new system in 2026, whether you choose bcrypt or Argon2 matters far less than the two numbers you feed whichever one wins. Pick either and tune it carelessly, and you've built a hash a rented GPU chews through before lunch.

So let me skip the feature-matrix ritual and go straight to the one property that actually separates these two β€” memory β€” and how to set the parameters so an attacker pays real money for every single guess.

Both are slow on purpose

General-purpose hashes like SHA-256 are built to be fast. Password hashes are built to be slow, deliberately, because the only person in a hurry to hash a password a billion times is an attacker who stole your database. bcrypt (Niels Provos and David Mazières, 1999) and Argon2 (the winner of the 2015 Password Hashing Competition) both share that DNA, and both mix in a per-password salt so identical passwords don't produce identical hashes. Neither is encryption — there's no key, and nothing decrypts back. If that whole family is fuzzy, bcrypt password hashing explained is the primer; this post is only about what the two do differently.

The whole fight is about memory

bcrypt is CPU-hard. It leans on processor work but uses a fixed, tiny footprint β€” about 4 KB of memory per hash. Argon2 is memory-hard: you tell it to burn, say, 64 MB of RAM on every single guess.

Picture a burglar. bcrypt makes them pick a lock at a workbench β€” irritating, but you can buy a thousand workbenches and pick a thousand locks at once. Argon2 makes each attempt rent an entire warehouse of scratch space, so a thousand parallel guesses means a thousand warehouses.

That's the entire advantage. GPUs and ASICs β€” the hardware that makes password cracking cheap β€” pack thousands of cores but comparatively little fast memory per core, so a memory-hard function turns that army of cores into a crowd standing around waiting for RAM. Which is exactly why a modern recommendation for a fresh system leans Argon2.

Use Argon2id, and know its three knobs

Argon2 ships in three variants. Argon2d maximizes GPU resistance but is more exposed to side-channel timing attacks; Argon2i defends against those but gives up a little brute-force resistance; Argon2id is the hybrid that current guidance recommends as the default. Use Argon2id unless you have a documented reason not to.

It exposes three parameters: memory cost (how much RAM per hash), time cost (how many passes), and parallelism (how many lanes). You tune them together toward a target time β€” more on that in a moment.

bcrypt's sharp edge, and why it's still fine

Now the honest counterpoint, because "newer" isn't "better by default." bcrypt has a real quirk: it only reads the first 72 bytes of a password and silently ignores the rest, so long passphrases need care β€” some systems pre-hash the input first, which has its own traps. And its fixed 4 KB means it simply can't match Argon2's memory story.

But bcrypt has 25 years of analysis, universal library support in every language you'd name, and no practical break. If you already run bcrypt with an adequate cost factor, ripping it out is rarely the best thing you could be doing with that hour. For the fuller picture of when an algorithm actually "breaks" versus merely ages, MD5 vs SHA-256 vs bcrypt walks each one to its verdict.

The verdict, and the two numbers that beat either name

New system? Reach for Argon2id. Keeping bcrypt? Raise the cost factor β€” each step from 10 to 11 to 12 doubles the work, and 12 or higher is a sane floor on modern hardware.

But here's the part almost nobody tunes: measure on your hardware. Set the parameters so a single hash takes roughly 250 to 500 milliseconds on the machine that'll actually run in production β€” slow enough to punish an attacker, fast enough that your login endpoint doesn't fall over under a crowd of real users. A "rounds = 10" copied from a 2012 tutorial is far too fast today, and that stale number does more damage than the algorithm choice ever will.

You can feel the cost-factor effect yourself with the bcrypt hash generator β€” bump the rounds and watch the delay grow β€” then confirm a password matches a stored hash with bcrypt compare. And whichever algorithm you land on, the hash is only half the job: a strong hash of a weak password is still a weak password. Generate real ones with the password generator and let the slow hash protect what was already hard to guess.

Try the tools

Frequently Asked Questions

Is Argon2 better than bcrypt?

For a new system, Argon2id is the current first recommendation because it's memory-hard β€” it forces each guess to occupy a set amount of RAM, which neutralizes the parallel-GPU attacks bcrypt's fixed 4 KB can't. But well-configured bcrypt with a high cost factor has 25 years of analysis behind it and no practical break, so 'better' depends on whether you're building new or maintaining something that already works.

Should I migrate my bcrypt passwords to Argon2?

Usually not as a priority. If your bcrypt cost factor is set adequately β€” 12 or higher on modern hardware β€” migrating is rarely the highest-value security work available. Raising the cost factor is a one-line change; a migration means re-hashing on next login and carrying two verifiers. Do it when you're already touching auth, not as an emergency.

Which Argon2 variant should I use?

Argon2id. It's the hybrid of Argon2i (side-channel resistant) and Argon2d (maximum GPU resistance), and it's the variant recommended as the default in current password-hashing guidance. Reach for Argon2i or Argon2d only if you have a specific, documented reason.

Is Argon2 or bcrypt encryption?

Neither. Both are one-way password hashes: they turn a password into a fixed verifier you compare against, with no key that reverses the process. If you can 'decrypt' a stored password, it wasn't hashed. Both also mix in a per-password salt automatically.

How do I choose Argon2 parameters?

Tune three knobs β€” memory cost, time cost (iterations), and parallelism β€” so one hash takes about 250–500 ms on the hardware that will actually run it. Start from current OWASP-style guidance for memory (tens of megabytes) and measure; don't copy numbers from an old post, because faster hardware makes yesterday's settings too easy.

DA

Dr. Anika Rhodes writes for CodeUtilityKit, where the team builds free, privacy-first developer tools that run entirely in your browser. Every guide is written and reviewed by developers who use these tools daily.