Copynix

Bcrypt Hash Generator and Verifier Online

10
4 (fast)β‰ˆ 700 ms14 (slow)

Higher cost = more secure but slower. 10–12 recommended for production.

Frequently Asked Questions

What is bcrypt?

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.

What is the cost factor (rounds)?

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.

Can I reverse a bcrypt hash to get the original password?

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.

Why is each bcrypt hash different even for the same password?

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.

What cost factor should I use for bcrypt in production?

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.

What is the maximum password length bcrypt can hash?

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.

How does bcrypt compare to Argon2 and scrypt?

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.

How to use

  1. 1

    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.

  2. 2

    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.

  3. 3

    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.

  4. 4

    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.

Use cases

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

Related Tools

SHA Hash

SHA-256, SHA-512 hashing

Password

Strong password generator

JWT Decode

Decode & inspect JWT tokens

JWT Sign

Build & sign JWT tokens

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.