JustGenerator
Hashing 100% Client-Side Privacy

Bcrypt Hash Generator

Create salted Bcrypt password hashes with configurable cost factors (rounds 4 to 14) and test plaintext passwords against stored Bcrypt hashes locally.

Max 72 UTF-8 bytes per Bcrypt spec
0 / 72 bytes

Higher rounds = slower (10 to 12 recommended)

What happens inside a 60-character Bcrypt string

Bcrypt was designed in 1999 by Niels Provos and David Mazieres around the Blowfish key setup schedule specifically so password verification stays slow even as hardware gets faster. Unlike SHA-256 or MD5, hashing the exact same password twice in Bcrypt produces two completely different outputs. That happens because Bcrypt generates a fresh 128-bit random salt every run and packs everything into one 60-character string.

Take a generated hash like $2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy. When you click Generate above, the Hash Breakdown panel splits it into its four pieces: the version prefix ($2a$, $2b$, or PHP's $2y$), the two-digit cost factor (10 means 2¹⁰ = 1,024 key-schedule rounds), the 22-character encoded salt, and the 31-character hash. Because the salt and cost live inside the hash itself, your database only needs a single VARCHAR(60) column.

Picking a cost factor without stalling your login server

Every +1 bump on the Cost Factor slider doubles the CPU time. On a typical laptop browser running pure JavaScript (bcryptjs), cost 10 finishes in roughly 80 to 150 milliseconds, cost 12 takes around 350 to 600 milliseconds, and cost 14 can take over 2 seconds. Native C/Rust implementations on a production Linux server run roughly 3x to 5x faster than JavaScript in a browser.

Benchmark on your actual production CPU rather than guessing. Aim for 100 to 250 milliseconds per login hash, which usually lands at cost 10, 11, or 12. Going too low (like cost 4 or 6) makes offline GPU cracking much cheaper; going too high (like cost 15) lets a handful of concurrent login requests saturate your API workers.

Watch out for the 72-byte truncation limit

One Bcrypt edge case catches teams off guard every year: the algorithm silently ignores every byte past byte 72 of the UTF-8 password. That means two 80-character passphrases that share the same first 72 bytes will both verify as valid against the same hash. Multi-byte characters like emojis take 4 bytes each, so the limit is measured in UTF-8 bytes rather than characters. The live 0 / 72 bytes counter above the password input turns red if you cross that line.

Verifying stored hashes during debugging

Switch to the Verify Password tab whenever you need to test a seed-user password from a SQL migration or confirm whether a legacy $2y$ hash from PHP matches a Node.js or Python user record. Everything runs locally via bcryptjs with zero network requests, so test credentials stay inside your browser tab. If you are building the rest of an authentication stack, pair Bcrypt with our OTP & TOTP Generator for 2FA testing and our Random Token Generator for session secrets.

Common questions

What is a salt in Bcrypt, and why is it needed?

A salt is a random 128-bit string that Bcrypt generates automatically and mixes into a password before hashing. Salting ensures that two users with the exact same password end up with completely different hashes, neutralizing precomputed rainbow tables. Bcrypt stores the salt inside the 60-character hash string itself, so you do not need a separate database column.

What is the Bcrypt cost factor (work factor or rounds)?

The cost factor controls how slow Bcrypt is by setting the key-setup loop to 2 raised to the power of the cost factor. A cost of 10 runs 1,024 iterations, 12 runs 4,096 iterations, and each +1 step doubles the computation time. Slowing down hashing stops attackers from testing billions of leaked password guesses per second on GPUs.

What is the recommended Bcrypt cost factor for production apps?

Most security teams choose a cost factor between 10 and 12 for web applications, targeting roughly 100 to 250 milliseconds per login hash on their production server hardware. As CPUs get faster over time, you can increase the cost factor and rehash user passwords transparently on their next login.

How do you read a 60-character Bcrypt hash string?

A Bcrypt string is divided by dollar signs, such as $2a$10$ followed by 53 Base64-like characters. The first segment ($2a$, $2b$, or $2y$) names the Bcrypt version, the second number (10) is the cost factor, the next 22 characters hold the encoded salt, and the final 31 characters are the password hash.

Can a Bcrypt hash be decrypted or reversed back into a password?

No. Bcrypt is a one-way cryptographic password hashing function based on the Blowfish cipher. During login, your server extracts the version, cost factor, and salt from the stored hash, hashes the password the user just typed, and compares the two strings in constant time.

Does Bcrypt have a maximum password length?

Yes. Standard Bcrypt only processes the first 72 bytes of a UTF-8 password and silently ignores any characters past byte 72. If your application permits very long passphrases, either enforce a 72-byte limit with clear validation or pre-hash long inputs carefully before passing them to Bcrypt.