Bcrypt Hash Generator

Generate bcrypt hashes and verify passwords against them

Runs in your browserUtility03Encoding & Crypto

What is Bcrypt Hash Generator?

This bcrypt tool generates salted password hashes and checks whether a password matches an existing hash, with the cost factor adjustable from 4 to 14 and the elapsed time displayed so the iteration cost is visible. Everything is computed locally in the browser and passwords are never uploaded.

How to use Bcrypt Hash Generator

  1. 1Enter a password and set the cost factor — use at least 10 for production.
  2. 2Click "Generate hash"; the result looks like $2b$10$... with the salt embedded inside it.
  3. 3Paste an existing hash into the right panel and click verify to check whether the password matches.
  4. 4Watch the timing: every increment of the cost factor doubles the work.

How do I do this in code?

Use the tool above for one-off work; for anything you repeat, move it into a script or your project.

import bcrypt from 'bcryptjs';

const hash = await bcrypt.hash(password, 12);
const matched = await bcrypt.compare(password, hash);

Frequently asked questions

Why does the same password produce a different hash every time?+

A new random salt is generated on each call and encoded into the hash string itself. As a result, two users who pick the same password still get different database rows, so an attacker cannot tell that their passwords match — and rainbow tables become useless.

What cost factor should I use?+

It depends on your server capacity and how much login latency you can accept. A common target is roughly 100 to 250 milliseconds per hash, which lands around cost 11 to 13 on most servers today. Remember that bcrypt weakens as hardware gets faster, so raise the cost periodically and upgrade stored hashes transparently when users log in.

Does bcrypt have a password length limit?+

Yes. bcrypt only processes the first 72 bytes and silently ignores the rest. If you allow very long passphrases — or passwords generated by a password manager — switch to Argon2id, or pre-hash the password with SHA-256 before handing it to bcrypt.

Related tools

All tools