Skip to content
gohacks.dev
Security

bcrypt Hash Generator

Hash a password with bcrypt at the cost you choose, or check a password against an existing $2y$ or $2b$ hash, entirely in your browser.

Free · No sign-up · Your inputs stay in your browser

Input

Generate and verify bcrypt hashes

Output

bcrypt

The output carries everything needed to check it: $2y$ is the variant (PHP writes 2y, others 2b; they are the same algorithm), then the cost, a 22-character salt and the 31-character hash. password_hash() and Hash::make() produce exactly this, so a hash made here verifies with password_verify(). Choose the highest cost your login endpoint can afford, around 100-250 ms on the server.

Runs in this browser. Nothing you paste is sent to a server.

Choosing the cost

Each step in cost doubles the work for you and for anyone guessing passwords offline. Laravel's default is 12; pick the highest value your login endpoint can afford, roughly 100 to 250 ms on the production server. The hash stores its cost, so you can raise it later and rehash on the next successful login (Laravel's Hash::needsRehash does the check). OWASP's Password Storage Cheat Sheet covers bcrypt alongside Argon2id.

The 72-byte limit

bcrypt only uses the first 72 bytes of the password, so two long passphrases that share a prefix produce the same hash. Multi-byte characters reach the limit sooner. Argon2id has no such limit.

Share

Frequently asked questions

What is the difference between $2a$, $2b$ and $2y$?
They are the same algorithm. $2y$ is PHP's marker from fixing a bug in an old implementation, $2b$ is OpenBSD's; current libraries verify all of them alike.
Can a bcrypt hash be decrypted?
No. It is a one-way function. A password can only be checked by hashing a candidate with the same salt and cost and comparing.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools