Skip to content
My Tiny Utils

Search tools

Type to find a tool, then press Enter to open it.

Bcrypt Hash Generator & Checker

Generate bcrypt password hashes at cost 4–14 and check a password against any $2a$, $2b$ or $2y$ hash. See the version, cost, salt and digest. Runs in your browser.

Processed locally in your browser — nothing is uploaded.

Bcrypt Hash Generator & Checker

0 of 72 bytes

10 · 1,024 rounds

Each step doubles the time to hash — and to brute-force. 10–12 suits most logins today.

Bcrypt hash

Output appears here…

Hashing and checking run in your browser with bcryptjs; passwords and hashes never leave this page. New hashes use the $2b$ prefix with a fresh random salt, so the same password gives a different hash every time.

About Bcrypt Hash Generator & Checker

Type a password, pick a cost factor, and get a bcrypt hash you can paste into a database seed, a config file, or a test fixture. Switch to Verify to check whether a password matches an existing hash — from Laravel, Rails, Django, Spring Security, Node or PHP's password_hash — with a clear match or no-match answer. Every hash is split into its parts as well: the version prefix, the cost, the 22-character salt and the 31-character digest.

Everything runs in your browser with bcryptjs, a pure-JavaScript implementation, so neither the password nor the hash is sent anywhere. Hashing yields to the page between slices of work, so even at cost 14 the tab stays responsive and shows its progress.

How a bcrypt hash is built

$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy reads as: $2a$ (the version), 10 (the cost — 2¹⁰ = 1,024 rounds of the expensive key setup), then 22 characters of salt and 31 characters of hash. The salt is stored in the hash itself, which is why a checker only needs the password and the hash, and why hashing the same password twice gives two different results.

Common uses

  • Create a hashed password for a seed script, an .htpasswd-style config, or an admin user inserted by hand
  • Check whether a password matches a hash from a database dump while debugging a login
  • Find the cost factor of existing hashes before raising it
  • Show a team why bcrypt hashes differ every time yet still verify

Example

Input

Password: correct horse battery staple
Cost:     10

Output

$2b$10$… (60 characters, new salt every time)
Version $2b$ · cost 10 · 1,024 rounds

Input

Password: U*U
Hash:     $2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW

Output

Match — the password produces this hash.

Limitations

  • Bcrypt reads only the first 72 bytes of a password (UTF-8, so an emoji counts as four). Anything past that is ignored; the byte counter warns you when a password crosses the limit.
  • New hashes use cost 4–14. Verifying is limited to cost 16 in the browser — a cost-20 hash would take minutes to check.
  • $2x$ hashes (from a buggy pre-2011 PHP library) and the bare $2$ prefix aren't supported.
  • Bcrypt is a one-way function: this tool can check a guess, but it can't recover the password from a hash.

Frequently asked questions

Can a bcrypt hash be decrypted?

No. Bcrypt is a one-way hash, not encryption, so there is no key that turns a hash back into the password. The only way to recover one is to guess passwords and hash each guess, which bcrypt deliberately makes slow. To check a specific password, use Verify: it hashes your guess with the salt stored in the hash and compares the results.

What cost factor (salt rounds) should I use for bcrypt?

Pick the highest cost your login can afford, aiming for roughly 100–250 ms per hash on your server. For most applications today that is 10 to 12; OWASP recommends at least 10. Each step up doubles the time for you and for an attacker, so revisit it every few years and rehash passwords at the new cost when users log in.

What's the difference between $2a$, $2b$ and $2y$?

They are the same algorithm with different bug-fix markers. $2a$ is the original OpenBSD format; $2b$ was introduced in 2014 after OpenBSD fixed a bug with passwords over 255 bytes; $2y$ is what PHP's crypt_blowfish writes to mark its corrected implementation. Modern libraries verify all three interchangeably, and this tool does too.

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

Each hash gets a new random 16-byte salt, stored in the 22 characters after the cost. Different salts produce different hashes, which stops attackers from using precomputed tables or spotting users who share a password. Verification still works because the checker reads the salt back out of the hash.

Why is there a 72-byte limit on bcrypt passwords?

Bcrypt feeds the password into the Blowfish key schedule, which takes at most 72 bytes, so anything longer is silently ignored: two passwords that share their first 72 bytes produce the same hash. Bytes are counted in UTF-8, so accented letters take two and emoji take four. For longer passphrases, some systems pre-hash with SHA-256 first, or use Argon2 instead.