# bcrypt.js: 6.2 out of 10

Reasonable, with limits. 6th of 10 in [Cryptography and password hashing](https://elestia.ai/opensource/crypto/index.md).

bcrypt.js is a pure-JavaScript bcrypt with no dependencies and built-in TypeScript types. It is correct, mature and very widely used. But OWASP now ranks bcrypt below Argon2id and scrypt for new systems, and the code is slower than the native binding, so it is a sound but second-tier choice for new work.

**Best for:** Teams that need bcrypt, or compatibility with existing bcrypt hashes, where native addons cannot be built, such as serverless functions, restricted build images or non-Node runtimes.

## Scores

- **Overall: 6.2** (likely 5.1 to 7.2)
  - Claude Opus 5.5 (6.0): It is a reliable, dependency-free bcrypt that suits places where native addons cannot be built, and it reads hashes from native bcrypt. For a new project, Argon2id through node-argon2, or hash-wasm where native code is a problem, follows current OWASP guidance better. Maintenance is quiet and rests on one person. It is a reasonable pick, but not the default.
  - GPT-6.2 Sol (6.3): bcrypt.js is a sound choice when existing bcrypt hashes must work in a deployment that cannot rely on native addons. For a fresh Node.js password store, node-argon2 offers OWASP’s preferred Argon2id algorithm and shows stronger maintenance and download momentum. bcrypt.js has credible downstream use, but the release gap and weak repository controls lower confidence in it as a new dependency.
- **Needed by many: 5.2** (likely 4.1 to 6.3)
  - Claude Opus 5.5 (6.0): Most web apps that keep their own user accounts need password hashing, so this is a large group. But many apps hand login to an auth provider, and this library does only bcrypt, with no signing or encryption. That makes it narrower than its category.
  - GPT-6.2 Sol (4.4): Password hashing is a common need for applications that manage their own credentials. bcrypt.js covers one password-hashing algorithm across Node.js and browsers, with its clearest use in systems that already store bcrypt hashes. Developer surveys establish how common web development is, but leave the share of teams that need bcrypt compatibility uncertain.
- **Helps a lot: 6.6** (likely 5.5 to 7.6)
  - Claude Opus 5.5 (6.0): It is a correct, compatible bcrypt with sync and async APIs, types and ESM. The API is small, and AI agents write correct code for it easily. It is held back by slower pure-JS speed than native bcrypt, by the 72-byte limit, and by an algorithm that OWASP ranks behind Argon2id, which node-argon2 and hash-wasm provide.
  - GPT-6.2 Sol (7.1): Version 3.0.3 has a small, typed API with examples that make routine hash and compare calls easy to write and review. Callers must check for 72-byte truncation, and a user report shows that invalid work factors can produce misleading errors. The async API yields between chunks of CPU work on the JavaScript thread. An independent FXServer benchmark found native bcrypt faster, though the margin will vary with the runtime and workload.
- **Holds up over time: 5.2** (likely 3.9 to 6.7)
  - Claude Opus 5.5 (5.5): The code is essentially finished. It had a major release and three fixes in 2025, but no commits or releases in the last 12 months, and one person maintains it. Only 1 issue is open, and a stable algorithm needs little change. Still, the field is moving toward Argon2id, and the bus factor is one.
  - GPT-6.2 Sol (4.9): The project recorded no commits or releases in the last year, while node-argon2 recorded 51 commits and shipped in November 2026. Version 3 changed the default module format and generated hash prefix, preserved existing hashes, and needed follow-up patches for types and module interoperability. npm lists one collaborator, and a July 2026 input-validation report remains open with a proposed fix. The stable bcrypt format keeps the library useful, but the small release team makes response times hard to predict.
- **Used widely: 7.5** (likely 6.5 to 8.3)
  - Claude Opus 5.5 (8.0): It has 79M downloads in 4 weeks and about 302k dependent repos, more than native bcrypt in both. That makes it one of the most used password hashers in JavaScript. Its download ratio of 3.79 is just below the 4.1 median, so it is slowly losing share, while node-argon2 grows much faster (7.1x).
  - GPT-6.2 Sol (7.0): Ecosyste.ms found about 302,000 dependent repositories, slightly ahead of native node.bcrypt.js and far ahead of node-argon2 in the same index. Four-week downloads rose from 20.9 million to 79.3 million, or 3.79×, below the 4.1× catalog median and node-argon2’s 7.06×. The package has 3,796 GitHub stars, while the snapshot found no matching Hacker News or Bluesky activity. Automated installs, framework dependencies, and continued v2 downloads make the share of fresh direct choices uncertain.
- **Vouched for: 6.5** (likely 5.1 to 7.7)
  - Claude Opus 5.5 (5.5): Many tutorials and comparisons name it as the standard pure-JS bcrypt, and hundreds of thousands of repos depend on it. But independent sources mostly present it as a fallback, and none recommends it first for new systems. We found no current benchmarks or survey data, and there is no Hacker News or Bluesky attention.
  - GPT-6.2 Sol (7.4): Parse Server ships v3.0.3 as its fallback when a native bcrypt package is unavailable, and Strapi uses bcrypt.js for admin authentication on v2.4.3. Next.js documents it as a portability fallback, and an independent FXServer benchmark measured v3.0.3 directly. These sources support its use for portable bcrypt, with limited evidence about developer satisfaction or performance across production workloads.
- **Safe: 6.6** (likely 5.5 to 7.8)
  - Claude Opus 5.5 (7.0): It has zero dependencies, no advisories ever, and a permissive BSD-3-Clause licence, so the attack surface is small. Against that, the OpenSSF Scorecard is 3/10, with no branch protection, no security policy, weak code review and one publisher. bcrypt's silent truncation at 72 bytes is a known pitfall the caller must handle.
  - GPT-6.2 Sol (6.2): The package has zero runtime dependencies, a permissive BSD-3-Clause licence, and zero recorded OSV advisories. The public workflow builds and tests before publishing with an npm token, and npm lists one collaborator. OpenSSF Scorecard gives it 3/10, with weak branch protection, code review, token permissions, and security reporting checks. Those checks and the quiet advisory record leave limited evidence about how quickly a serious incident would be handled.

## Good

- Zero dependencies and no native build step, so it installs anywhere JavaScript runs.
- Its hashes work in both directions with the native bcrypt package, so you can switch between them without rehashing.
- v3 ships ESM with a UMD fallback, bundled TypeScript types and $2b$ hashes by default.
- No known security advisories in more than ten years on npm.

## Bad

- bcrypt is a legacy-tier algorithm in OWASP guidance; Argon2id is preferred for new systems.
- Pure JavaScript is slower than the native bcrypt binding, so each hash costs more CPU on busy login servers.
- The 72-byte input limit is still the caller's problem; v3 only adds a helper to check the length.
- One maintainer, no commits in the last year, and weak OpenSSF Scorecard practices (3/10).

## The numbers

- Downloads, 4 weeks: 79M
- In a year: ×3.8
- GitHub stars: 3.8k
- Commits, 12 months: 0
- Last npm release: Nov 2025
- Advisories, 24 months: 0
- Licence: BSD-3-Clause
- GitHub: https://github.com/dcodeIO/bcrypt.js
- npm: https://www.npmjs.com/package/bcryptjs

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
