The best password hashing algorithm in 2026 is Argon2id, with at least 19 MiB of memory, 2 iterations and 1 degree of parallelism, per the OWASP Password Storage Cheat Sheet. Use scrypt if Argon2id is unavailable, PBKDF2-HMAC-SHA256 at 600,000 iterations where FIPS 140 compliance is required, and bcrypt only in legacy systems.
Key takeaways
- Argon2id is the best choice for new systems: memory-hard, side-channel resistant and standardized as RFC 9106.
- OWASP minimums are Argon2id at 19 MiB, scrypt at N=2^17, bcrypt at cost 10 and PBKDF2-HMAC-SHA256 at 600,000 iterations.
- Never store passwords with MD5, SHA-1 or plain SHA-256: fast hashes let attackers guess billions of passwords quickly.
Passwords must be stored with a slow, salted, memory-hard hash — never in plain text and never with a fast hash like SHA-256. Eight algorithms can do the job, but only one is the right default in 2026.
How did we choose these password hashing algorithms?
We ranked the algorithms by the guidance developers actually follow: the OWASP Password Storage Cheat Sheet, RFC 9106 for Argon2, and NIST SP 800-63B for federal systems. Security, library support and compliance needs all counted.
Every algorithm here is free and open: there is no license to buy, only a library to use. The "cost" column in the table therefore means the implementation cost, not a price.
- Memory-hardness — does it force attackers to spend memory, not just time?
- Standardization — is it an RFC, a NIST specification or an OWASP recommendation?
- Library support — can you use it in Python, Node.js, Go, Rust and .NET without exotic dependencies?
- Compliance fit — does it meet FIPS 140 or legacy system constraints?
Which password hashing algorithm should you use?
For new code, use Argon2id. For FIPS-regulated systems, use PBKDF2. For existing bcrypt systems, keep bcrypt and raise the cost factor. Everything else is a niche choice.
| Algorithm | Best for | Memory-hard | OWASP minimum |
|---|---|---|---|
| Argon2id | New systems | Yes | 19 MiB, t=2, p=1 |
| Argon2i | Side-channel risk | Yes | 19 MiB, t=2, p=1 |
| scrypt | Argon2 unavailable | Yes | N=2^17, r=8, p=1 |
| bcrypt | Legacy systems | No | Cost 10 or more |
| PBKDF2 | FIPS 140 compliance | No | 600,000 iterations (SHA-256) |
| Argon2d | Maximum GPU resistance | Yes | 19 MiB, t=2, p=1 |
| Balloon hashing | Provable memory-hardness | Yes | No OWASP minimum published |
| yescrypt | Modern alternative | Yes | No OWASP minimum published |
The 8 best password hashing algorithms
Each entry gives what the algorithm is, its OWASP or standard parameters where they exist, its strengths and limits, and who should pick it. Parameters are minimums: benchmark on your own hardware and raise them if you can.
1. Argon2id — best password hashing algorithm overall
Argon2id won the Password Hashing Competition in 2015 and was standardized as RFC 9106 in 2021. It is a hybrid of the Argon2i and Argon2d variants, resisting both side-channel attacks and GPU-based cracking.
- Key features: tunable memory, time and parallelism; PHC string format stores parameters with each hash; libraries in every major language.
- Pros: memory-hard; OWASP first choice; flexible parameters for different hardware.
- Cons: needs a library in some stacks; not FIPS-approved.
- Parameters: OWASP minimum m=19456 (19 MiB), t=2, p=1. Higher-memory options trade CPU for RAM.
- Pick it if: you are writing new code with no compliance constraint forcing another algorithm.
2. Argon2i — best for side-channel resistance
Argon2i is the data-independent variant of Argon2: its memory access pattern does not depend on the password. That makes it resistant to side-channel attacks that observe memory access.
- Key features: same three parameters as Argon2id; data-independent memory access.
- Pros: strongest side-channel protection of the Argon2 family.
- Cons: slightly weaker against GPU attacks than Argon2id; rarely the best default.
- Parameters: OWASP lists the same minimums as Argon2id, except the 46 MiB with t=1 option, which is not for Argon2i.
- Pick it if: your threat model includes attackers who can observe memory access patterns.
3. scrypt — best if Argon2id is unavailable
scrypt, created by Colin Percival in 2009, was the first widely deployed memory-hard password hash. OWASP recommends it when Argon2id is not available, and it ships in the Node.js standard library.
- Key features: memory-hard design; parameters N, r and p; built into several standard libraries.
- Pros: proven in production for over a decade; no extra dependency in Node.js.
- Cons: uses more memory than Argon2id for equivalent security; newer designs have passed it.
- Parameters: OWASP minimum N=2^17 (128 MiB), r=8, p=1.
- Pick it if: your platform lacks a trustworthy Argon2 library but supports scrypt.
4. bcrypt — best for legacy systems
bcrypt, published in 1999 by Niels Provos and David Mazières, is built on the Blowfish cipher and has an adaptive cost factor. It remains safe in 2026 when tuned correctly, and it is deeply embedded in existing systems.
- Key features: adaptive work factor; 184-bit output; supported everywhere.
- Pros: battle-tested for 25 years; simple to use; huge library support.
- Cons: not memory-hard, so GPUs attack it more cheaply; 72-byte input limit; cost below 10 is no longer safe.
- Parameters: OWASP minimum cost 10; use cost 12 or higher on modern hardware if your server can absorb it.
- Pick it if: your codebase already uses bcrypt and migration is not justified yet.
5. PBKDF2 — best for FIPS 140 compliance
PBKDF2, specified in RFC 2898 and NIST SP 800-132, is the only algorithm here that is FIPS 140 approved. NIST SP 800-63B-4, final since July 2025, points verifiers to PBKDF2 for federal systems.
- Key features: iteration-based key derivation; works with HMAC-SHA256 or HMAC-SHA512; FIPS-approved.
- Pros: the only compliant choice for regulated systems; supported in every platform.
- Cons: not memory-hard, so GPUs attack it cheaply; needs very high iteration counts.
- Parameters: OWASP minimum 600,000 iterations for HMAC-SHA256, or 220,000 for HMAC-SHA512.
- Pick it if: a FIPS 140 validation requirement rules out Argon2, bcrypt and scrypt.
6. Argon2d — best for maximum GPU resistance
Argon2d is the data-dependent variant of Argon2, optimized to resist GPU cracking. Its memory access depends on the password, which makes it faster for the defender but open to side-channel observation.
- Key features: strongest GPU resistance in the Argon2 family; same parameters as Argon2id.
- Pros: best raw resistance to parallel hardware attacks.
- Cons: vulnerable to side-channel attacks; OWASP recommends Argon2id instead for password storage.
- Parameters: use the Argon2id minimums as a starting point, m=19456, t=2, p=1.
- Pick it if: you need maximum GPU resistance and side channels are not in your threat model.
7. Balloon hashing — best for provable memory-hardness
Balloon hashing is a memory-hard function designed with a security proof: it is the first password hash with a proof that it needs the memory it claims. It is a strong academic design with growing library support.
- Key features: provable memory-hardness; tunable space and time costs.
- Pros: the clearest security argument of any algorithm here; simple design.
- Cons: no OWASP minimum published; far less library support and production use than Argon2id.
- Parameters: no OWASP minimum; follow the Balloon paper's recommended settings and benchmark on your hardware.
- Pick it if: you want a provably memory-hard design and can accept a smaller ecosystem.
8. yescrypt — best modern alternative to scrypt
yescrypt is a modern password hashing function that builds on scrypt, adding features for wide use in password-based key derivation. It is used in some Linux distributions for password storage.
- Key features: scrypt-compatible modes; tunable memory and time; designed for system password storage.
- Pros: modern design with good performance; adopted by Linux distributions.
- Cons: no OWASP minimum published; smaller ecosystem than Argon2id or bcrypt.
- Parameters: no OWASP minimum; use the defaults of a trusted implementation and benchmark them.
- Pick it if: you want a modern scrypt successor with system-level adoption.
How do you choose a password hashing algorithm?
Work through the constraints in order. Compliance comes first, then what your platform supports, then the security properties. Most teams land on Argon2id in under a minute.
- FIPS 140 required: PBKDF2 is your only sanctioned option here.
- New system, no FIPS: Argon2id at the OWASP minimums, raised after benchmarking.
- Argon2 unavailable: scrypt at N=2^17, r=8, p=1.
- Existing bcrypt deployment: keep bcrypt, raise the cost to 12 or higher, and plan migration at the next major change.
- Side-channel worries: Argon2i or Argon2id, not Argon2d.
Whatever you choose, use a trusted library rather than writing your own implementation. Our free hash generator can show you what a hash looks like, but production code should use a maintained password-hashing library. The OWASP Password Storage Cheat Sheet lists the current minimum parameters for each algorithm.
What about salts, peppers and work factors?
A salt is a unique random string added to each password before hashing. It stops rainbow-table attacks and means identical passwords produce different hashes. Modern libraries generate salts automatically, so you rarely handle them yourself.
A pepper is a secret shared across stored passwords and kept separate from the database, usually in a secrets vault or hardware security module. It adds defense in depth: an attacker with only the database cannot crack the hashes. Changing a pepper forces affected users to reset their passwords.
The work factor is how slow the hash is. OWASP says a single hash should take less than one second, and you should benchmark on your own server. Raise the work factor over time as hardware improves, re-hashing passwords when users next log in.
What should you avoid in password hashing?
Avoid fast hashes entirely. MD5, SHA-1 and plain SHA-256 are designed for speed, so attackers with GPUs can test billions of guesses per second. OWASP is explicit: fast hashing algorithms are not suitable for password storage.
- Plain text or reversible encryption: hashing is one-way; encryption can be reversed if the key leaks.
- One salt for all users: a shared salt lets attackers crack every password at once.
- Fixed, low work factors: a cost chosen years ago is too weak for today's hardware.
- Writing your own algorithm: use a maintained library; custom crypto fails in ways that are hard to see.
- Truncating passwords silently: bcrypt ignores input beyond 72 bytes, so enforce a limit or pre-hash safely.
If you are unsure whether your current setup is weak, check whether your users' passwords already appear in known breaches with our pwned password checker.
Generate strong replacements with our free password generator.
The bottom line
Use Argon2id for new systems, scrypt when Argon2id is unavailable, PBKDF2 where FIPS 140 compliance is required, and bcrypt only where it already lives. Set the OWASP minimum parameters, benchmark them on your hardware, and raise them as hardware improves.
Good password hashing will not save a weak password, so pair it with strong password rules and phishing-resistant MFA. Our guide to spear phishing explains why stolen credentials are so valuable to attackers in the first place.
Frequently asked questions
What is the best password hashing algorithm in 2026?
Argon2id, at a minimum of 19 MiB of memory, 2 iterations and 1 degree of parallelism, per the OWASP Password Storage Cheat Sheet. If Argon2id is unavailable, scrypt at N=2^17, r=8, p=1 is the alternative, and PBKDF2-HMAC-SHA256 at 600,000 iterations covers FIPS 140 requirements.
Is bcrypt still safe in 2026?
Yes, if it is tuned correctly. OWASP says bcrypt should only be used in legacy systems where Argon2 and scrypt are not available, with a work factor of 10 or more. Many teams now use cost 12 or higher on modern hardware, and bcrypt has a 72-byte input limit.
What is the difference between Argon2id and bcrypt?
Argon2id is memory-hard, so it forces attackers to spend memory as well as time, which makes GPU attacks expensive. bcrypt is time-hard but uses little memory, so GPUs can attack it more cheaply. Argon2id also lets you tune memory, time and parallelism separately.
Why is SHA-256 bad for password hashing?
SHA-256 is designed to be fast, which is the opposite of what password storage needs. Attackers with GPUs can compute billions of SHA-256 hashes per second, so a leaked database of SHA-256 password hashes falls quickly. Slow, salted, memory-hard algorithms are required instead.
What is a salt in password hashing?
A salt is a unique, randomly generated string added to each password before hashing. It stops attackers from using precomputed rainbow tables and means two users with the same password get different hashes. Modern libraries generate and manage salts automatically.
What is a pepper in password hashing?
A pepper is a secret value shared across stored passwords, kept separate from the database, usually in a secrets vault or hardware security module. It adds defense in depth: an attacker with only the database cannot crack the hashes. If a pepper is compromised, affected users must reset their passwords.
How do I migrate from bcrypt to Argon2id?
Re-hash passwords when users next log in, since you cannot convert a hash without the original password. Store both hash types during the transition, verify against the old hash on login, then replace it with an Argon2id hash. Users who never log in keep the old hash until they reset.
Sources
- OWASP — Password Storage Cheat Sheet
- RFC 9106 — Argon2 Memory-Hard Function for Password Hashing
- WorkOS — Picking a password hash: a developer's guide to argon2, bcrypt, and scrypt
- NIST — SP 800-63B Digital Identity Guidelines: Authentication and Lifecycle Management
- Software Security — Password hashing: Argon2id, scrypt, bcrypt and PBKDF2
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the OWASP Password Storage Cheat Sheet, RFC 9106 and NIST SP 800-63B-4.
How we write and fact-check →