Loading…

Bcrypt Generator

Create a bcrypt hash from any text or password, choose the cost factor and see how long it takes. Every hash is split into its version, cost, salt and digest so you can see how it works, and the Verify bcrypt tab checks whether a text matches a bcrypt hash you already have. Hashes are calculated securely on our server, and your text is never stored or logged.

  • Free
  • No sign-up
  • Secure HTTPS processing
  • Never stored or logged

Last updated

How to use the Bcrypt Generator

  1. Type or paste the text or password you want to hash.
  2. Set the cost with the slider. 10 is the recommended minimum; higher is stronger but slower.
  3. Click Generate. Your bcrypt hash appears right below, ready to copy. Pick the prefix ($2y$, $2b$ or $2a$) your software expects.
  4. To check a bcrypt hash, open the Verify bcrypt tab, enter the text and paste the hash.

Why use this tool

  • Real bcrypt with an adjustable cost from 4 to 12, and the server time for each hash.
  • A new random salt every time, so the same password gives a different hash each click.
  • Breaks any bcrypt hash into version, cost, salt and digest, colour-coded.
  • Verifies hashes from PHP, Laravel, Node.js, Python and other tools.
  • Secure by design: sent over HTTPS, processed in memory, never stored or logged.

What is bcrypt?

bcrypt is a password hashing function designed in 1999 by Niels Provos and David Mazières, based on the Blowfish cipher. Unlike general-purpose hashes such as MD5 or SHA-256, which are built to be fast, bcrypt is built to be slow on purpose. That matters because an attacker who steals a database of password hashes can only recover passwords by guessing, and a slow hash makes every guess expensive.

bcrypt is also adaptive: it has a cost setting that you can raise as computers get faster, so the same algorithm stays hard to attack for decades. It generates its own random salt, so you do not have to manage one, and identical passwords never produce identical hashes.

What a bcrypt hash looks like

Every bcrypt hash is 60 characters long and has four parts, which this tool colours for you:

  • Version, such as $2y$. It names the variant of the algorithm.
  • Cost, such as 10$. This is the base-2 logarithm of the number of rounds, so a cost of 10 means 1,024 rounds.
  • Salt: 22 random characters that are stored inside the hash.
  • Digest: the final 31 characters, which are the actual hash of the password.

The versions $2a$, $2b$ and $2y$ are names for the same algorithm as it was fixed over time. PHP writes $2y$, while Node.js and Python usually write $2b$. For normal passwords they all verify the same way, and most libraries accept every prefix. Use the prefix menu above to match what your software expects.

Choosing the cost factor

The cost is the main setting. Each increase of one doubles the work, for you and for an attacker. Choose the highest value that keeps logins fast enough on your own server, and raise it over time.

CostRoundsWhen to use it
416Automated tests only. Far too weak for real passwords.
8256Below the recommended minimum.
101,024The recommended minimum for new systems.
124,096A strong default. Laravel uses 12 for new applications.
13 and above8,192 and aboveHigh-security systems with fast servers. Create these in your own code.

This generator offers costs 4 to 12 and shows how many milliseconds the server needed, which gives you a feel for the effect. Timings vary with the hardware, so always measure on the machine that will run your logins.

Using bcrypt in your own code

In real applications, hash passwords with your framework or a maintained library, not with an online tool. In PHP:

$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);

if (password_verify($password, $hash)) {
    // the password is correct
}

In Laravel, use Hash::make($password) and Hash::check($password, $hash). In Node.js, use the bcrypt package: await bcrypt.hash(password, 12). In Python, use the bcrypt package: bcrypt.hashpw(password, bcrypt.gensalt(12)).

Limits and alternatives

  • 72-byte limit. bcrypt only reads the first 72 bytes of the input, so longer passwords are cut off. If you must accept very long passphrases, hash them with SHA-256 first and encode the result, or choose another algorithm.
  • Not memory-hard. bcrypt needs little memory, so attackers can use graphics cards effectively. Argon2id was designed to resist this and is the current first choice for new systems where it is available.
  • Still a solid choice. bcrypt has been used and studied for more than 25 years, it is supported everywhere, and a well-chosen cost makes it very hard to attack.

How this tool works, and your privacy

bcrypt cannot be done natively in a web browser, so this tool calculates the hash on our server. Your text is sent over an encrypted HTTPS connection, hashed in memory, returned to you and discarded. It is not saved to a database, written to a log or shared, and responses are marked so browsers do not cache them. Requests are rate limited to protect the service.

Do not paste a real production password into any online tool. Use a test value instead, or generate the hash in your own code.

Bcrypt Generator FAQ

It turns a password or any text into a bcrypt hash, the standard way to store passwords safely. You choose the cost, and the tool adds a random salt for you.
bcrypt creates a new random salt for each hash and stores it inside the result. The hashes differ, but each one still verifies correctly against the same password.
Use at least 10. Laravel defaults to 12. Pick the highest value that keeps your login fast enough, because each step up doubles the work for you and for an attacker.
They are versions of the same algorithm. $2y$ is what PHP writes and $2b$ is common in Node.js and Python. For normal passwords they all verify the same way, and most libraries accept every prefix.
No. bcrypt is a one-way hash, not encryption. The only way to check a password is to hash it again with the same salt and cost and compare the results, which is what the Verify bcrypt tab does.
bcrypt only uses the first 72 bytes. The tool warns you when your text is longer. Characters after that point do not change the hash.
Your text is sent over HTTPS, hashed in memory and not stored or logged. For real production passwords we still recommend hashing in your own code, as with any online tool.
Yes. SHA-256 is fast, so attackers can test billions of guesses per second. bcrypt is deliberately slow and adds a salt, which makes it far better for passwords.
Argon2id is newer and also resists graphics cards by using a lot of memory, so it is preferred for new systems. bcrypt remains a secure, widely supported choice.
Higher costs take noticeably longer on a shared server. For cost 13 or more, generate the hash in your own code on hardware you control.