Skip to content
Researched developer tool comparisonsPrices dated · vendor sources linked · no star ratings
Search

Stage 02 · Test · Researched comparison

Best Node JS Password Hashing Libraries in 2026

argon2 is the first pick for most new Node.js projects. It implements the Argon2id algorithm that OWASP recommends as a default, and it ships prebuilt binaries for common platforms. Choose bcrypt if you need the widest ecosystem support and battle-tested behavior. Choose bcryptjs if you cannot compile native modules, and use the built-in crypto.scrypt module if you want zero dependencies.

By
Published 27 Nov 2026 · 6 tools compared

We run no ads and no affiliate links at launch. The order of a list follows our published method. See how we score.

Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.

Key takeaways

  • argon2 is the strongest default for new projects because it supports Argon2id with tunable memory, time and parallelism costs.
  • bcrypt remains a safe, widely deployed choice, but keep the 72-byte input limit in mind.
  • bcryptjs and @node-rs/argon2 cover environments where native builds are difficult or slow.
  • crypto.scrypt ships with Node.js, so it adds no dependency and no supply-chain surface.

Who each pick is for

  • New projects that want the OWASP-recommended Argon2id defaultargon2
  • Teams that want the most widely deployed password hashing modulebcrypt
  • Serverless and bundled environments where native modules failbcryptjs
  • Projects that want a fast Argon2 binding with prebuilt binaries@node-rs/argon2
  • Teams that want a built-in option with no third-party dependencycrypto.scrypt
  • Legacy systems that must stay on PBKDF2 for compliancecrypto.pbkdf2

Comparison

The 6 tools at a glance
ToolBest forStandout featureListed starting priceFree plan or trial
1argon2New projects that want the OWASP-recommended Argon2id defaultSupports Argon2id, Argon2i and Argon2dFree (open source)Free plan
2bcryptTeams that want the most widely deployed password hashing moduleLong track record and broad ecosystem supportFree (open source)Free plan
3bcryptjsServerless and bundled environments where native modules failPure JavaScript, so no compiler or prebuilt binary is neededFree (open source)Free plan
4@node-rs/argon2Projects that want a fast Argon2 binding with prebuilt binariesRust-based binding with prebuilt binaries for many platformsFree (open source)Free plan
5crypto.scryptTeams that want a built-in option with no third-party dependencyShips with Node.js, so no install or supply-chain riskFreeFree plan
6crypto.pbkdf2Legacy systems that must stay on PBKDF2 for complianceBuilt into Node.js with no dependencyFreeFree plan

How we picked

We compared libraries on fit for password hashing in Node.js, supported algorithms, native versus pure-JS implementation, platform support, licence, maintenance activity and the limits each one documents. Sources are vendor pages, the Node.js API documentation and project repositories. We did not run benchmarks or collect user reviews. Prices and free-plan terms can change, so confirm details on the official page before you commit.

The tools, one by one

01

argon2

Best for new projects that want the OWASP-recommended Argon2id default

Visit github.com
argon2 homepage
argon2 homepage, captured Nov 2026

What it is and where it fits

argon2 is a Node.js binding to the reference Argon2 implementation. It hashes and verifies passwords with Argon2id, Argon2i or Argon2d, and lets you set memory cost, time cost and parallelism. OWASP lists Argon2id as its preferred password hashing algorithm, which makes this library the natural first choice for new code.

The package is published under the MIT licence and installs prebuilt binaries for common platforms. Where no prebuilt binary exists, installation needs a C compiler and node-gyp. The API is promise-based and simple: call hash, store the encoded string, then call verify on login.

Skip it if your deployment target cannot run native modules, or if you must stay on an algorithm your existing database already stores. For those cases, use bcryptjs or crypto.scrypt.

Standout: Supports Argon2id, Argon2i and Argon2d

Pricing pointer

Free (open source), as listed by the vendor (argon2 website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Supports Argon2id, Argon2i and Argon2d
  • exposes memory, time and parallelism cost settings

Drawbacks

  • Native module needs a build toolchain on some platforms
  • API differs from bcrypt

Skip it if this limit matters to you: native module needs a build toolchain on some platforms.

Verdict. A sensible pick for new projects that want the OWASP-recommended Argon2id default.

Alternatives in this guide: bcrypt, bcryptjs, @node-rs/argon2

02

bcrypt

Best for teams that want the most widely deployed password hashing module

Visit github.com
bcrypt homepage
bcrypt homepage, captured Nov 2026

What it is and where it fits

bcrypt is the most established password hashing module for Node.js. It wraps the OpenBSD bcrypt algorithm and exposes hash, compare, genSalt and a synchronous variant. The cost factor controls how much work each hash takes, and the encoded output stores the salt and cost so verification needs no extra columns.

The library is MIT licensed and installs prebuilt binaries for common platforms. It needs a compiler when no prebuilt binary matches your system. The main limit is the algorithm itself: bcrypt only reads the first 72 bytes of input, so very long passphrases are truncated. If that matters, pre-hash with SHA-256 or pick Argon2.

Choose bcrypt when you need maximum compatibility with existing systems and tutorials. Skip it for greenfield projects where Argon2id is available.

Standout: Long track record and broad ecosystem support

Pricing pointer

Free (open source), as listed by the vendor (bcrypt website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Long track record and broad ecosystem support
  • simple hash and compare API

Drawbacks

  • Native build required
  • input is truncated at 72 bytes

Skip it if this limit matters to you: native build required.

Verdict. A sensible pick for teams that want the most widely deployed password hashing module.

Alternatives in this guide: argon2, bcryptjs, @node-rs/argon2

03

bcryptjs

Best for serverless and bundled environments where native modules fail

Visit github.com
bcryptjs homepage
bcryptjs homepage, captured Nov 2026

What it is and where it fits

bcryptjs is a pure JavaScript implementation of bcrypt. It needs no compiler, no node-gyp and no platform-specific binary, which makes it useful for serverless functions, Electron apps and bundlers that struggle with native addons. The API matches bcrypt closely, so swapping between them is mostly a change to the import line.

It is MIT licensed and has no runtime dependencies. The trade-off is speed: pure JavaScript runs slower than the native binding, so a high cost factor can add noticeable latency. It also inherits bcrypt's 72-byte input truncation.

Use bcryptjs when native builds are a problem and you still want bcrypt-compatible hashes. If you can run native modules, prefer bcrypt or argon2 for better throughput.

Standout: Pure JavaScript, so no compiler or prebuilt binary is needed

Pricing pointer

Free (open source), as listed by the vendor (bcryptjs website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Pure JavaScript, so no compiler or prebuilt binary is needed
  • API mirrors bcrypt

Drawbacks

  • Slower than the native module
  • same 72-byte input limit

Skip it if this limit matters to you: slower than the native module.

Verdict. A sensible pick for serverless and bundled environments where native modules fail.

Alternatives in this guide: argon2, bcrypt, @node-rs/argon2

04

@node-rs/argon2

Best for projects that want a fast Argon2 binding with prebuilt binaries

Visit github.com
@node-rs/argon2 homepage
@node-rs/argon2 homepage, captured Nov 2026

What it is and where it fits

@node-rs/argon2 is an Argon2 binding built with the napi-rs toolchain. It provides prebuilt binaries for a wide range of platforms, including some where the reference binding needs a compiler. It supports Argon2id and the usual memory, time and parallelism parameters.

The package is MIT licensed and published from the node-rs monorepo, which also hosts other Rust-based Node.js addons. Because documentation lives in the monorepo rather than a dedicated site, read the package README and the Argon2 parameter guidance before setting costs.

Pick it if you want Argon2id with fewer install problems than a source build. Skip it if you prefer a single-purpose repository or cannot use native modules at all.

Standout: Rust-based binding with prebuilt binaries for many platforms

Pricing pointer

Free (open source), as listed by the vendor (@node-rs/argon2 website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Rust-based binding with prebuilt binaries for many platforms
  • supports Argon2id

Drawbacks

  • Part of a larger monorepo, so docs live outside the package
  • another native dependency

Skip it if this limit matters to you: part of a larger monorepo, so docs live outside the package.

Verdict. A sensible pick for projects that want a fast Argon2 binding with prebuilt binaries.

Alternatives in this guide: argon2, bcrypt, bcryptjs

05

crypto.scrypt

Best for teams that want a built-in option with no third-party dependency

Visit nodejs.org
crypto.scrypt homepage
crypto.scrypt homepage, captured Nov 2026

What it is and where it fits

The Node.js crypto module includes scrypt and scryptSync. OWASP lists scrypt as an acceptable password hashing algorithm when Argon2id is not available. Because it is part of the standard library, there is nothing to install and no dependency to audit.

The catch is that scrypt is a primitive, not a password storage format. You must generate a random salt, store the parameters alongside the hash, and compare with a timing-safe function. The API is callback-based, though you can wrap it in a promise.

Use crypto.scrypt when you want zero dependencies and are willing to write a small helper. Skip it if you want a ready-made encoded string format like the argon2 and bcrypt packages provide.

Standout: Ships with Node.js, so no install or supply-chain risk

Pricing pointer

Free, as listed by the vendor (crypto.scrypt website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Ships with Node.js, so no install or supply-chain risk
  • supports tunable cost parameters

Drawbacks

  • Lower-level API you must wrap yourself
  • no encoded hash format included

Skip it if this limit matters to you: lower-level API you must wrap yourself.

Verdict. A sensible pick for teams that want a built-in option with no third-party dependency.

Alternatives in this guide: argon2, bcrypt, bcryptjs

06

crypto.pbkdf2

Best for legacy systems that must stay on PBKDF2 for compliance

Visit nodejs.org
crypto.pbkdf2 homepage
crypto.pbkdf2 homepage, captured Nov 2026

What it is and where it fits

crypto.pbkdf2 and crypto.pbkdf2Sync are part of the Node.js standard library. PBKDF2 is a long-standing algorithm that many compliance frameworks still accept, and OWASP lists it as a fallback when Argon2id and scrypt are not options.

Like scrypt, it is a primitive. You handle salt generation, iteration count, storage format and timing-safe comparison. The iteration count must be tuned to your hardware and reviewed over time as hardware gets faster.

Choose PBKDF2 only when a standard, an existing database or a platform constraint requires it. For new password storage, Argon2id or scrypt are better fits.

Standout: Built into Node.js with no dependency

Pricing pointer

Free, as listed by the vendor (crypto.pbkdf2 website). Confirm the current plan price before you buy.

Free plan. Plans change, so confirm on the vendor's pricing page before you buy.

Benefits

  • Built into Node.js with no dependency
  • accepted by many compliance standards

Drawbacks

  • Not memory-hard, so weaker against GPU attacks than Argon2id
  • manual salt and format handling

Skip it if this limit matters to you: not memory-hard, so weaker against GPU attacks than Argon2id.

Verdict. A sensible pick for legacy systems that must stay on PBKDF2 for compliance.

Alternatives in this guide: argon2, bcrypt, bcryptjs

Who should use what

New projects with no legacy constraints should start with argon2 and Argon2id. Teams that must match existing bcrypt hashes should stay on bcrypt, or use bcryptjs where native builds fail, such as serverless functions. Projects that want zero third-party dependencies should wrap crypto.scrypt in a small helper. Systems bound by a compliance rule that names PBKDF2 should use crypto.pbkdf2 with a reviewed iteration count.

Questions to settle before you buy

What to check before you buy

  • Confirm the library supports the algorithm you plan to store, and that you can migrate existing hashes.
  • Check that prebuilt binaries exist for your deployment platform, or that a build toolchain is available.
  • Set cost parameters from current OWASP guidance and re-check them as hardware changes.
  • Verify the library compares hashes in constant time and stores the salt with the hash.
  • Review the licence and the last commit date on the repository before adding the dependency.

FAQ

Which password hashing algorithm should Node.js use in 2026?

OWASP recommends Argon2id as the first choice, with scrypt and bcrypt as acceptable alternatives and PBKDF2 as a fallback. In Node.js, that maps to the argon2 package or @node-rs/argon2 for Argon2id, crypto.scrypt for scrypt and bcrypt or bcryptjs for bcrypt.

Is bcrypt still safe to use?

Yes, bcrypt is still considered safe when used with an adequate cost factor. Its main limit is that it only reads the first 72 bytes of input. If you need to support very long passphrases, pre-hash the input or move to Argon2id.

Should I use bcryptjs or bcrypt?

Use bcrypt when native modules install cleanly, because it is faster. Use bcryptjs when you cannot compile native code, such as in some serverless or bundled environments. Both produce bcrypt-compatible hashes with the same 72-byte limit.

Can I use the built-in crypto module instead of a library?

Yes. crypto.scrypt and crypto.pbkdf2 ship with Node.js and need no install. You must handle salt generation, parameter storage and timing-safe comparison yourself, so a small helper module is usually needed.

Do these libraries send password data anywhere?

No. All the options listed run locally in your Node.js process. Avoid pasting real passwords or production hashes into third-party online hash generators or debugging pages.

Sources we checked

Method: how we score · editorial policy.

  1. argon2 (official site)
  2. bcrypt (official site)
  3. bcryptjs (official site)
  4. @node-rs/argon2 (official site)
  5. crypto.pbkdf2 (official site)
  6. crypto.pbkdf2 (official site)

Change log. First published 27 Nov 2026.