Higher cost = more secure but slower. 10β12 recommended for production.
Bcrypt is a password hashing algorithm designed to be slow and computationally expensive, making brute-force attacks impractical. It is the most widely recommended algorithm for storing passwords.
The cost factor determines how many iterations (2^n) are used to compute the hash. Cost 10 means 1,024 iterations, cost 12 means 4,096. Higher cost = slower hashing = harder to brute-force, but also slower for legitimate logins.
No. Bcrypt is a one-way hash β it is computationally infeasible to reverse. You can only verify a password by hashing it with the same salt and comparing the result.
Bcrypt automatically generates a random 22-character salt and embeds it in the hash output. This means the same password produces a different hash each time, preventing rainbow table attacks.
Cost 10 is the widely accepted default β it takes ~100ms per hash, which is negligible for login but impractical for mass cracking. Increase to 12 if your server can handle the latency. Re-evaluate every few years as hardware becomes faster; bcrypt's cost factor lets you adapt without re-hashing all passwords.
Bcrypt truncates input at 72 bytes. Passwords longer than 72 bytes are treated as identical up to that length. For very long passphrases, pre-hash with SHA-256 before bcrypt, or use Argon2 which has no length limit.
All three are slow password hashing algorithms. Argon2 (the PHC winner) is the modern recommendation β it is memory-hard, making GPU attacks more expensive, and has no 72-byte limit. Scrypt is also memory-hard. Bcrypt is older but battle-tested and widely supported in all languages and frameworks.
Bcrypt is the gold standard for password storage. Unlike SHA or MD5, bcrypt is intentionally slow β designed to make brute-force attacks computationally expensive. This tool lets you generate and verify bcrypt hashes entirely in your browser for testing and learning.
Enter the password to hash
Type or paste the password you want to hash in the password field. The input is never sent to any server.
Choose a cost factor
The cost factor (4-14) controls the number of rounds (2^n). Cost 10 (1,024 rounds) takes about 100ms β the standard for production. Cost 4 is fast for testing. Cost 14 is very slow but extremely resistant to brute force.
Generate the hash
Click 'Generate Bcrypt Hash.' The output is a 60-character string starting with $2b$ that includes the algorithm version, cost factor, salt, and the hash itself.
Verify a password against a hash
Switch to the Verify tab. Enter the original password and the bcrypt hash to confirm they match β simulating how your login system verifies a user's credentials.
Learn password hashing for development
Understand what bcrypt output looks like, how the cost factor affects performance, and why the same password produces a different hash each time (due to the embedded random salt).
Test your login verification logic
Generate a known bcrypt hash for a test password, add it to your test database, and verify your application correctly accepts the matching password and rejects wrong ones.
Audit legacy password storage
If migrating from MD5 or SHA-based password hashing, generate bcrypt hashes here to compare the output format with your existing hashes and plan your migration strategy.
Bcrypt is an adaptive password hashing function designed specifically for secure password storage. Unlike SHA-256 or SHA-512, which are optimized for speed, bcrypt is intentionally slow β it applies the Blowfish cipher in repeated rounds (the work factor) so that verifying one hash takes a meaningful amount of time. This makes brute-force and dictionary attacks orders of magnitude more expensive than attacking plain SHA hashes.
The work factor (cost parameter, typically 10β12) determines how many rounds of hashing are applied β each increment doubles the computation time. A bcrypt hash embeds the salt and cost factor directly in its output string, so no separate salt storage is needed. Use this tool to hash passwords for testing, verify whether a plaintext matches a stored bcrypt hash, or understand the output format before integrating a bcrypt library into your application.