BcryptGenerator.org

Bcrypt Hash Checker

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.

Processed in your browser — no data sent to servers

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:

$2b$12$RB2qR6GI4quP.PUs6xR5He37dCyunLcYFzlvUfwSX41XkRXgOQ3OS
Version
$2b$
Algorithm variant: $2a$, $2b$ or $2y$
Cost
12
Work factor: 2¹² = 4,096 key-setup rounds
Salt
RB2qR6GI4quP.PUs6xR5He
22 characters encoding a random 16-byte salt
Hash
37dCyunLcYFzlvUfwSX41XkRXgOQ3OS
31 characters encoding the 23-byte result

How bcrypt verification works

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.

Why a bcrypt check fails (and how to fix it)

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.

  1. 1
    Hashing the password again and comparing stringsEvery call to 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.
  2. 2
    The hash was cut off in the databaseA bcrypt hash is always exactly 60 characters. A 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.
  3. 3
    $ signs removed by your shell or .env fileShells, Docker Compose and many .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).
  4. 4
    Invisible whitespace or a trailing newlineCopying from a terminal or reading from a file often adds a newline, and secret and secret\n are different inputs. Trim the stored hash and check how the password is read. This checker trims pasted hashes automatically.
  5. 5
    Different pre-processing on each sideSome apps pre-hash passwords (for example with SHA-256) or normalize them before calling bcrypt. If the code that creates the hash and the code that checks it don't do exactly the same steps, the comparison fails.
  6. 6
    Passwords longer than 72 bytesbcrypt only uses the first 72 bytes of a password, so two long passwords that share the same first 72 bytes both match. Some newer libraries reject longer input instead of truncating it, which can make an old hash appear not to verify.
  7. 7
    A library that does not recognize the prefix$2y$ (PHP) and $2b$ produce identical hashes. A library that rejects $2y$ will usually accept the same hash with the prefix changed to $2b$.

Checking a bcrypt hash in code

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.

Frequently Asked Questions

Can a bcrypt hash be decrypted?+

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.

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

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.

Is it safe to paste a real hash and password into this page?+

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.

What is the difference between $2a$, $2b$ and $2y$?+

$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.

Why does the checker refuse hashes with a very high cost?+

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?