Bcrypt Hash Generator
Hash a password with bcrypt at a cost factor from 4 to 16, or check a password against an existing $2a$, $2b$ or $2y$ hash. Uses bcryptjs in your browser.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Bcrypt Hash Generator?
The Bcrypt Hash Generator hashes a password with bcrypt at a cost factor you choose (4 to 16 salt rounds) and can verify a password against an existing bcrypt hash. It uses the bcryptjs library, a pure JavaScript implementation that produces $2b$ hashes compatible with the bcrypt libraries used in Node.js, Python, PHP, Ruby and Go.
Hashing and verification run in your browser. The last 10 hashes you generate are kept in the page's history panel for that session and can be cleared. Verification checks the hash format first, so a mistyped or truncated hash is reported as invalid rather than as a wrong password.
Because bcryptjs runs in JavaScript, high costs are slow here: each step up doubles the time, and cost 16 can take several seconds. Server libraries written in C are faster at the same cost.
- bcryptjs hashing with 4, 6, 8, 10, 12, 14 or 16 salt rounds
- Verify a password against an existing $2a$, $2b$ or $2y$ hash
- Hash format check before verifying
- Session history of the last 10 hashes
- Runs in your browser; passwords are not uploaded
Updated
How to use the Bcrypt Hash Generator
- Type a password and choose Salt Rounds. 10 to 12 is a typical production range.
- Click Generate Hash and copy the resulting $2b$ string.
- To check a password, enter it with an existing hash in the verify section and click Verify Password. Clicking a history item puts its hash in the verify box.
- Use Clear to empty the inputs and history when you are done.
Worked examples
Hashing at cost 10
Input
Password hunter2, Salt Rounds 10
Output
$2b$10$4Zeucj1cflPQijmRF7ta1OkCIJEgJGnQOtxdCPxsh1ZWaMTJhxwDO (60 characters)
Your hash will differ because the salt (the 22 characters after $10$) is random each time. Verifying hunter2 against either hash still succeeds.
The 72-byte limit
Input
A 72-character password, then the same password with EXTRA appended
Output
Both verify against the same hash
bcrypt ignores everything after byte 72. Pre-hashing long inputs is possible but has its own pitfalls; Argon2id avoids the limit.
Background and insight
Bcrypt was introduced by Niels Provos and David Mazières at USENIX in 1999, built on Bruce Schneier's Blowfish cipher. Its key idea is an adjustable cost: each increment of the cost factor doubles the work needed to compute one hash. As hardware gets faster, you raise the cost and the hash stays expensive to brute-force.
A bcrypt string carries everything needed to verify it. In $2b$12$ followed by 53 characters, "2b" is the algorithm version, "12" is the cost (2^12 iterations of the key setup), the next 22 characters are the random salt, and the last 31 are the hash itself. Because the salt is built in, two users with the same password get different hashes.
Bcrypt has one well-known quirk: it only uses the first 72 bytes of the password. That rarely matters for human passwords but can matter if you pre-concatenate values. OWASP's Password Storage Cheat Sheet currently lists Argon2id first, then scrypt, with bcrypt as a solid choice for existing systems and a recommended minimum cost of 10.
Common use cases
Seeding test users
Generate a known bcrypt hash to insert into a development database so you can log in as a test user.
Debugging login failures
Check whether a stored hash really matches the password you expect.
Choosing a cost factor
Try different salt rounds and feel how much slower each step becomes.
Teaching password storage
Show why the same password produces a different hash every time.
Tips and limitations
- Aim for roughly 100 to 250 ms per hash on your production servers, and benchmark there, not in a browser.
- PHP's password_hash writes $2y$; Node and Python write $2b$. They are the same algorithm and verify each other's hashes.
- Store the full 60-character string in a column of at least CHAR(60). Truncating it breaks every login.
- When you raise the cost, rehash on the next successful login rather than forcing a reset.
- Use dummy passwords here. Real credentials belong only in your password manager and your application.
Sources and further reading
- A Future-Adaptable Password Scheme, USENIX. Provos and Mazières' 1999 bcrypt paper
- Password Storage Cheat Sheet, OWASP. Argon2id, scrypt and bcrypt, with recommended work factors
- RFC 9106: Argon2 Memory-Hard Function for Password Hashing and Proof-of-Work Applications, IETF
- RFC 7914: The scrypt Password-Based Key Derivation Function, IETF
Frequently asked questions
What bcrypt cost factor should I use?
Pick the highest value that keeps login fast enough on your servers, commonly 10 to 12 in 2026. OWASP recommends at least 10. Measure on production hardware: a hash should take somewhere around 100 to 250 milliseconds, and each extra cost step doubles that time.
Why is the bcrypt hash different every time for the same password?
Each hash uses a new random 128-bit salt, stored as the 22 characters after the cost in the hash string. Verification reads the salt back out of the stored hash and recomputes, so a password still matches every hash generated from it.
What is the difference between $2a$, $2b$ and $2y$?
They are revisions of the bcrypt format. $2b$ fixed a bug in OpenBSD's handling of passwords longer than 255 bytes, and $2y$ is PHP's marker for its own fixed implementation. Modern libraries, including the one on this page, verify all three.
Is bcrypt still recommended for password storage?
Yes for existing systems, with a cost of at least 10. For new systems OWASP lists Argon2id first and scrypt second, mainly because they are memory-hard and resist GPU cracking better. Migrating an existing bcrypt system is rarely urgent.
Why does verification say the hash format is invalid?
A bcrypt hash must be exactly 60 characters: $2a$, $2b$ or $2y$, a two-digit cost, a dollar sign, then 53 characters. A truncated database column, a copied quote or a different algorithm (such as an MD5 hex string) fails that check before any comparison runs.
Is there an in-depth guide to the Bcrypt Hash Generator?
Yes. “Bcrypt Explained: Salts, Cost Factors and Storing Passwords Safely” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.