Anatomy of a bcrypt hash
Every bcrypt hash is a 60-character string that stores everything needed to check a password: the algorithm version, the cost, the salt and the hash itself. Here is a real cost-12 hash of correct horse battery staple:
Paste a bcrypt hash and a password to check whether they match. The checker also shows the hash's version and cost, and the guide below explains the most common reasons a bcrypt check fails.
Every bcrypt hash is a 60-character string that stores everything needed to check a password: the algorithm version, the cost, the salt and the hash itself. Here is a real cost-12 hash of correct horse battery staple:
Verification never decrypts anything. The checker reads the cost and salt from the stored hash, runs bcrypt on the password you entered with those same settings, and compares the result with the stored hash. If they are identical, the password is correct.
Because the salt and cost live inside the hash, you only ever store one value per user. It also means an attacker who steals the hash still has to guess passwords one at a time, paying the full cost of bcrypt for every guess. See how many bcrypt rounds to use for how the cost factor affects that.
If you are sure the password is right but the check still fails, it is almost always one of these. For code examples and fixes in Node.js, PHP and Python, read the full guide: why bcrypt.compare() returns false.
hash() generates a new random salt, so hashing the same password twice gives two different results. Never compare hash(password) == storedHash. Use the library's compare() / verify() function, which reuses the salt stored in the hash.VARCHAR(50) column, or a form field with a length limit, either rejects it or silently truncates it, and every check fails. Use VARCHAR(255) (MySQL) or text (PostgreSQL). See the bcrypt hash length guide..env loaders treat $2b and $12 as variables and replace them with nothing. Wrap the hash in single quotes, or escape each $ (as $$ in Docker Compose).secret and secret\n are different inputs. Trim the stored hash and check how the password is read. This checker trims pasted hashes automatically.$2y$ (PHP) and $2b$ produce identical hashes. A library that rejects $2y$ will usually accept the same hash with the prefix changed to $2b$.Use your library's compare function. It extracts the salt and cost from the hash for you and compares the result in constant time.
Node.js (bcrypt or bcryptjs)
const ok = await bcrypt.compare(password, storedHash)PHP
$ok = password_verify($password, $storedHash);Python (bcrypt)
ok = bcrypt.checkpw(password.encode(), stored_hash.encode())Full walkthroughs: Node.js, PHP and Python. Need a fresh hash to test with? Create one with the bcrypt generator.
No. Bcrypt is a one-way function, so there is nothing to decrypt. The only way to find out whether a password matches is to hash the candidate password with the salt and cost stored in the hash and compare the results, which is exactly what this checker does.
Each hash gets a new random 16-byte salt, stored in characters 8–29 of the hash. Different salts produce different hashes, but every one of them still verifies against the same password.
The check runs entirely in your browser with the bcryptjs library, and nothing you type is sent to a server. Even so, avoid pasting live production credentials into any website; use test accounts where you can.
$2a$ is the original prefix. $2y$ was introduced by PHP after fixing a bug in its implementation, and $2b$ by OpenBSD after fixing a separate length-handling bug. Modern libraries produce identical output for all three, so a hash with any of these prefixes can be checked here.
Each extra cost round doubles the work, and JavaScript bcrypt in a browser is slower than a native server library. Cost 16 can already take ten seconds or more, and cost 20+ can take minutes, so the checker stops at 16 instead of freezing the tab.
What is Bcrypt?
How bcrypt works, salting, and why it is slow by design.
How Many Rounds?
OWASP guidance and benchmarks for choosing the right cost factor.
Bcrypt vs Argon2
Which password hashing algorithm should you use in 2026?