Bcrypt hash generator and checker

Hash a password with bcrypt, or check a password against an existing $2b$ hash. It runs in your browser with the bcryptjs library, and the page shows how long each hash took.

runs in your browser · nothing uploaded

loading tool…

How to use it

  1. Type a password and choose the cost factor. 10 is the OWASP minimum; 12 is a common choice today.
  2. Press Hash. The hash appears with the time it took in this browser.
  3. To check a password, type it and paste a bcrypt hash below, then press Check.

Reading a bcrypt hash

A hash like $2b$12$wmqVBk/A4/lvsceEu9Q3.ev06gF0OCeSqpwxLBDVy5l3xTCZCErHe holds everything needed to check it: the version (2b), the cost (12), a 22-character salt, and a 31-character result. That is why you store only this one string.

The cost is a power of two: cost 12 runs 4,096 rounds and each step up doubles the time. On our test machine with Node.js 22 and bcryptjs, cost 10 took 90 ms and cost 12 took 303 ms (raw output in examples/generators).

Two things bcrypt gets wrong

bcrypt only uses the first 72 bytes of a password. Our run confirms that 72 bytes plus anything else still matches the hash of the first 72. The page warns you when a password is longer.

bcrypt is also not memory-hard, so GPUs attack it more cheaply than Argon2id or scrypt. OWASP lists it as the choice for legacy systems; new projects should prefer Argon2id. The guide below measures the alternatives.

Questions

Is the password sent to a server?

No. Hashing runs in your browser with bcryptjs. Still, avoid typing a real password you use somewhere into any website.

Why does the same password give a different hash each time?

Each hash gets a new random salt, stored inside the hash. To check a password, bcrypt reads that salt back out and hashes again, so a fresh hash never matches an old one as text.

Can a bcrypt hash be decrypted?

No. It is a one-way function. The only attack is guessing passwords and hashing each guess, which the cost factor makes slow.

What do $2a$, $2b$ and $2y$ mean?

They are versions. $2b$ is current; $2a$ came before a bug fix; $2y$ is PHP's name for the fixed version. Modern libraries accept all three.

// go deeper
Hash passwords in Node.js: SHA-256 vs scrypt, measured
read the guide →