navaja.dev / bcrypt

bcrypt generator and checker

Hash a password with bcrypt, or check whether a password matches an existing hash. Everything runs in your browser, so the password and hash are never sent anywhere.

How to use the bcrypt tool

  1. Hash: type a password, pick a cost factor and press Hash password. You get a 60-character string like $2b$12$… that already contains the salt.
  2. Verify: switch to Verify, paste a hash from your database and type a password. You see at once whether they match.
  3. Inspect: any hash is split into its version, cost and 22-character salt, which helps when debugging logins across languages.

What a bcrypt hash contains

A bcrypt hash such as $2b$12$R9h/cIPz0gi.URNNX3kh2OPST9/PgBkqquzi.Ss7KIUgO2t0jWMUW has four parts: the version (2b), the cost (12, meaning 212 rounds of key setup), a 22-character salt, and a 31-character digest, both in bcrypt's own Base64 alphabet. Because the salt is stored inside the hash, you never store it separately, and hashing the same password twice gives two different strings that both verify.

Choosing a cost factor

$2a$, $2b$ and $2y$

$2b$ is the current version. $2a$ is the older label (some implementations had a length bug), and $2y$ is PHP's name for the corrected algorithm. All three produce the same result for normal passwords, and most libraries verify any of them. This checker accepts all three.

bcrypt in code

Questions

Is it safe to type a real password here?

The password and hash never leave your browser: hashing runs in a background worker on your device and nothing is sent, logged or stored. Still, avoid pasting production secrets into any website; use a test password when you can.

Can a bcrypt hash be decrypted?

No. bcrypt is a one-way hash, not encryption. The only way to recover a password is to guess it and compare, and bcrypt's cost factor makes each guess deliberately slow.

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

Each hash gets a new random 16-byte salt, stored inside the hash itself. Verification reads the salt from the hash, so every version still matches the password.

What is the 72-byte limit?

bcrypt only uses the first 72 bytes of a password and ignores the rest. Long passphrases or multi-byte characters can hit it; the tool warns you when a password is longer. If you need longer inputs, use Argon2id or pre-hash carefully.

Which cost factor should I use?

Pick the highest cost that keeps hashing near 250 ms on your server, usually 10 to 12. Costs above 16 are not run here because they take too long in a browser.

Is bcrypt still recommended?

Yes, bcrypt is still a sound choice for password storage. Argon2id is the newer recommendation from OWASP, and scrypt is also good. Never store passwords with MD5, SHA-1 or plain SHA-256.

Does this work with PHP $2y$ hashes?

Yes. $2y$ hashes from PHP's password_hash verify here, as do $2a$ and $2b$ hashes from Node.js, Python, Ruby, Go and Java libraries.