Choosing a password hashing algorithm is one of those backend decisions that looks settled until you have to implement it, tune it, or migrate old hashes without breaking logins. This guide compares bcrypt, scrypt, and Argon2 in practical terms: what each algorithm is designed to do, how to evaluate tradeoffs, where each one still fits, and how to make an update-friendly choice that you can revisit as hardware, libraries, and security guidance evolve.
Overview
If you are comparing bcrypt vs Argon2, or wondering whether scrypt vs bcrypt is still a meaningful choice, the short answer is that all three are purpose-built password hashing algorithms, but they are not equal in design goals or long-term flexibility.
Password hashing is different from general-purpose hashing. A fast hash is useful for checksums, content integrity, or deduplication. For password storage, fast is the wrong goal. You want a deliberately slow, hard-to-parallelize function that raises the cost of offline cracking if a password database is exposed.
That is why secure password storage generally relies on algorithms that provide some mix of:
- Salted hashing so identical passwords do not produce identical outputs
- Configurable work factors so you can increase cost over time
- Resistance to parallel hardware attacks such as GPUs or specialized cracking rigs
- Mature libraries that are easy to use correctly in real production systems
At a high level:
- bcrypt is mature, widely supported, and still common in production systems.
- scrypt adds memory hardness, which helps defend against hardware-accelerated attacks more effectively than CPU-only designs.
- Argon2, especially Argon2id in many modern recommendations, is often the algorithm developers evaluate first for new systems because it is designed for flexible tuning across memory, time, and parallelism.
That does not mean every team should rush to replace bcrypt tomorrow. A secure system is usually the one that is implemented correctly, monitored, and upgraded thoughtfully. For many applications, the real question is not “Which algorithm wins?” but “Which algorithm can we deploy correctly now, tune safely, and migrate cleanly later?”
How to compare options
The useful way to compare password hashing algorithms is not by brand recognition. It is by how they behave under attack, how they fit your runtime, and how easy they are to maintain over several years.
Use the following criteria when evaluating password hashing best practices for a new or existing application.
1. Security model
Ask what kind of attacker you are defending against. For password storage, the main concern is usually offline cracking after database exposure. If an attacker has your password hashes, they can test large numbers of guesses without touching your live app. In that scenario, algorithms that are costly in both time and memory generally age better than ones that rely mostly on CPU work.
2. Tunability
You should be able to make the hash more expensive as hardware improves. bcrypt offers a cost factor. scrypt adds memory-related parameters. Argon2 gives you separate controls for memory, iterations, and parallelism. More knobs are not automatically better, but they can help when you need to tune for different deployment environments.
3. Operational practicality
Password verification happens during login, password change, and sometimes account recovery flows. If you set costs too high, you may create login latency or increase server load enough to impact real users. A strong algorithm with poor tuning can turn into a reliability problem.
This is similar to other backend tradeoffs: the safest implementation is rarely the one with the most extreme settings, but the one with settings your infrastructure can sustain consistently.
4. Library quality and ecosystem support
In practice, implementation quality matters as much as algorithm choice. A well-maintained library with a clear API is often safer than a theoretically stronger algorithm wrapped in fragile code. Review whether your language ecosystem offers:
- Widely used libraries
- Safe defaults
- Built-in salt handling or encoded parameter storage
- Constant-time verification helpers where appropriate
- Clear upgrade paths
If your team works across services, consistency matters. Mixed stacks are common in modern systems. For example, a Python API, a Node.js worker, and an admin tool in another language may all need to verify or migrate password hashes.
5. Migration cost
The strongest design on paper may not be the best short-term move if you already have millions of users on bcrypt. You need to evaluate whether you can:
- Verify legacy hashes during login
- Rehash transparently after successful authentication
- Support multiple formats during a transition window
- Measure progress without forcing mass password resets
This is where architecture matters. Authentication articles often focus on tokens and sessions, but password storage remains foundational. If you are reviewing your auth stack more broadly, it helps to pair this topic with a system-level review such as REST API Authentication Methods Compared: API Keys, OAuth, JWT, and Sessions.
Feature-by-feature breakdown
This section gives you a practical comparison of bcrypt, scrypt, and Argon2 without pretending there is one perfect answer for every application.
bcrypt
What it is: bcrypt is a long-established password hashing algorithm built around an adaptive cost factor. It has been used for years and remains common because it is battle-tested and broadly available.
Strengths:
- Mature and well understood
- Strong library support across major languages
- Simple cost tuning model
- Still a reasonable choice when implemented with current cost settings and sound operational practices
Limitations:
- Less flexible than newer designs
- Not as naturally memory-hard as scrypt or Argon2
- Password length handling and encoding details need careful review in some implementations
Best reading of bcrypt today: bcrypt is often best viewed as the dependable incumbent. If you already use it correctly, it is not automatically an emergency. But if you are designing a new system and can choose more modern primitives without friction, many teams will also consider Argon2 first.
scrypt
What it is: scrypt is a password hashing function designed to make attacks more expensive by requiring significant memory as well as computation.
Strengths:
- Memory hardness improves resistance to large-scale parallel cracking
- Established and still relevant in many environments
- Often considered a meaningful step beyond purely CPU-oriented approaches
Limitations:
- Parameter selection can feel less straightforward for teams that want simple deployment defaults
- Ecosystem support may be less uniform than bcrypt in some stacks
- Operational tuning still requires real benchmarking under expected load
Best reading of scrypt today: scrypt remains a serious option, especially where memory hardness is desired and library support is strong in your stack. It may not be the default answer for every new app, but it is far from obsolete.
Argon2
What it is: Argon2 is a newer password hashing design intended to provide flexible protection through configurable memory, time cost, and parallelism. In many modern discussions, Argon2id is the variant developers evaluate most often for password hashing.
Strengths:
- Modern design with strong emphasis on tunability
- Memory-hard behavior helps against hardware-accelerated attacks
- Separate controls for memory use, iterations, and parallelism allow more deliberate tuning
- Often the leading candidate for new applications where library support is mature enough
Limitations:
- More configuration options mean more room for uncertainty if teams do not benchmark or document choices
- Support quality varies by platform, framework, and hosting environment
- Migration from older formats still requires careful rollout planning
Best reading of Argon2 today: For many new systems, Argon2 is the algorithm to evaluate first. Not because it makes everything else instantly wrong, but because it gives teams a modern and flexible basis for password storage if their language and deployment stack support it well.
Comparison table
| Algorithm | Main advantage | Main tradeoff | Good fit |
|---|---|---|---|
| bcrypt | Maturity and broad ecosystem support | Less flexible and less memory-hard than newer options | Existing systems, simple upgrades, broad compatibility |
| scrypt | Memory hardness | Parameter complexity and uneven ecosystem preference | Systems that want memory cost without switching to Argon2 |
| Argon2 | Modern tunability across memory and time | Requires careful configuration and dependable library support | New builds and planned migrations |
What not to use for password storage
It is worth stating directly: general-purpose hashes such as SHA-256, SHA-1, or MD5 are not appropriate for password storage by themselves, even if salted. They are designed to be fast. Fast hashing helps attackers test more guesses per second.
The same warning applies to “roll your own” schemes that combine multiple fast hashes and custom separators. Custom complexity is rarely a substitute for a dedicated password hashing algorithm.
Best fit by scenario
Most teams do not need a universal winner. They need a practical answer for their current system.
If you are building a new application
Start by evaluating Argon2, assuming your language, framework, and deployment platform provide a mature implementation. Document the parameters you choose and why. Benchmark on production-like infrastructure rather than relying on a generic example from a README.
If Argon2 support is weak or inconsistent in your environment, scrypt or bcrypt can still be better choices than forcing a fragile integration.
If you already use bcrypt
Do not assume you must replace it immediately. First confirm the basics:
- Unique salt handling is built in or correctly managed
- Your cost factor is still appropriate for your infrastructure
- Your password reset and login flows are instrumented
- You have a migration path if you decide to adopt a newer algorithm later
A common and low-risk approach is rehash on login. When a user successfully authenticates with a legacy bcrypt hash, you verify it, then create a new hash with your current preferred algorithm and parameters, and store that updated value. This avoids forcing every user through a reset on day one.
If you need strong resistance to parallel cracking
Look closely at scrypt and Argon2 because memory hardness is a central part of the conversation. In practice, many teams lean toward Argon2 for new deployments because of its design flexibility, but scrypt remains a valid choice where it is better supported or already integrated.
If you operate in a constrained environment
Some teams run workloads in environments where memory is tightly budgeted or where auth happens at very high scale. In that case, the best answer is often the one you can benchmark and sustain reliably. Aggressive settings that trigger resource spikes can create real operational risk.
Think of tuning as part of your backend performance work, not just a security checkbox. The same disciplined testing mindset you use when debugging API failures or timing issues should apply here too. For example, teams that already have strong habits around request handling and failure paths often make better choices in auth infrastructure. Related operational thinking appears in articles like Fetch API Error Handling Patterns You Can Reuse in Production, even though the implementation layer is different.
If you are planning a migration
Use a staged plan:
- Inventory existing hash formats and where they are verified.
- Add support for reading both old and new formats.
- Rehash on successful login into the new algorithm and parameter set.
- Track migration coverage over time.
- Retire legacy verification only after an intentional cutoff.
Store enough metadata with the hash to identify the algorithm and parameters used. Good password hash encodings often carry this directly. That makes future upgrades much easier because verification code can decide what to do based on the stored format rather than hidden assumptions.
If your authentication layer also uses tokens, keep responsibilities separate. Password hashing protects stored secrets; token handling solves session or API authorization concerns. If your team mixes those concepts, review JWT Decoder Guide: How to Read Tokens Safely and Validate Claims to reinforce the difference between password storage and token inspection.
When to revisit
Password hashing choices should not be made once and forgotten. The practical value of this topic is that it deserves periodic review whenever your environment changes.
Revisit your decision when any of the following happens:
- Your infrastructure changes, such as moving to different instance sizes, serverless platforms, or edge environments
- Your auth traffic changes, especially if login volume or peak concurrency increases
- Your framework or language support improves, making a modern algorithm easier to adopt safely
- Your security review uncovers legacy assumptions, such as low work factors or inconsistent verification code
- New options or new guidance appear, which may affect what “best current practice” looks like
A practical review checklist for 2026 and beyond looks like this:
- Confirm which algorithms are currently in your database.
- Check whether parameters are still intentionally chosen, not historical leftovers.
- Benchmark verification latency on production-like hardware.
- Verify that new passwords and reset flows use the same standard.
- Ensure your code can detect old hashes and upgrade them automatically.
- Document the rationale in your auth or security runbook.
- Set a reminder to review again when hardware, traffic, or library support changes.
If you want one default recommendation: for many new applications, evaluate Argon2 first; for existing systems on bcrypt, prioritize correct implementation and a clean migration plan over reactive churn; and for teams where scrypt is already well supported, treat it as a valid and serious option rather than an afterthought.
The best password hashing strategy is not the one with the loudest reputation. It is the one your team can explain, benchmark, operate, and upgrade with confidence.