Security Tools

Bcrypt Generator

This free Bcrypt Generator creates a 60-character bcrypt hash from any text with a cost factor of 4 to 14 salt rounds (default 10), or checks whether text matches an existing $2a$, $2b$ or $2y$ hash. Hashing and comparing run in your browser with the bcryptjs library, so nothing is sent to a server.

Runs in your browser. Your files and text never leave your device - nothing is uploaded.

Runs entirely in your browser - nothing is sent to a server. Higher salt rounds are slower but more resistant to brute-force attacks; 10-12 is the typical production default.

Generate and Verify Bcrypt Hashes Online

The Tools Kit’s free Bcrypt Generator turns any text into a bcrypt hash with the cost factor you choose, from 4 to 14 salt rounds. Switch to compare mode and it works as a bcrypt hash checker too, telling you whether a password matches a hash you already have, which is handy when you are seeding a database, writing test fixtures or debugging a login that fails.

Everything runs in your browser with the open-source bcryptjs library, so the text you type and the hash it produces are never sent to a server. Need a strong value to hash in the first place? Create one with the password generator.

How to Use the Bcrypt Generator

  1. 1

    Choose a mode

    Open the Mode menu and pick Generate hash to create a new bcrypt hash, or Compare text to a hash to check a password against a hash you already have.

  2. 2

    Enter the text

    Type or paste the password or other text into the text field. Use a test value rather than a real production password whenever you can.

  3. 3

    Set the salt rounds

    In Generate mode, enter a cost factor between 4 and 14. It defaults to 10; values outside the range are clamped to 4 or 14, and an empty or invalid entry falls back to 10.

  4. 4

    Generate or compare

    Click Generate hash and copy the 60-character result, or, in Compare mode, paste the existing hash and click Compare to see Match or No match.

Because a new random salt is used every time, clicking Generate hash again gives a different result for the same text. Every one of those hashes will still verify against that text.

Anatomy of a Bcrypt Hash

A bcrypt hash is a self-describing, 60-character string that carries everything needed to check a password later. Take this example, generated with 10 rounds:

$2a$10$Hl.4F7S9Kii/LHfVJGKD2O0vaAhxNw9.N6we7ZBBDCUAm1XSlDbV2

PartIn the exampleMeaning
Version$2a$The bcrypt format revision (this tool always produces 2a)
Cost factor10$Salt rounds; the work done is 210 = 1,024 rounds of key setup
SaltHl.4F7S9Kii/LHfVJGKD2O22 characters encoding 16 random bytes
Hash0vaAhxNw9.N6we7ZBBDCUAm1XSlDbV231 characters encoding the 23-byte result

The dollar-sign prefix is part of the modular crypt format, which is why a bcrypt string is easy to recognize. If you have a hash and are not sure which algorithm made it, paste it into the hash identifier before trying to verify it here.

Choosing the Cost Factor (Salt Rounds)

The cost factor is an exponent: the work bcrypt does is 2 to the power of the rounds you set. Each step up doubles the time it takes to hash a single password, so 12 rounds is four times slower than 10, and 14 rounds is sixteen times slower. That slowness applies equally to an attacker trying millions of guesses against a stolen database.

Salt roundsIterations (2n)Time relative to 10 rounds
4 (minimum here)161/64
82561/4
10 (default)1,0241x
124,0964x
14 (maximum here)16,38416x

Low values such as 4 are only useful for fast unit tests. For real logins, pick the highest cost your servers can handle while keeping sign-in responsive, and raise it over time as hardware gets faster. At 14 rounds the page may pause for a moment while the hash is computed, since the work happens on your own device.

Bcrypt vs SHA-256 and MD5 for Passwords

General-purpose digests such as those from the SHA-256 hash generator and the MD5 hash generator are designed to be fast and give the same output for the same input every time. That is ideal for checksums and file integrity, but poor for passwords: identical passwords produce identical hashes, and attackers can test enormous numbers of guesses per second. Bcrypt adds a unique salt to every hash and lets you tune how slow each guess is.

Bcrypt has one well-known limit: it only reads the first 72 bytes of the input, and anything beyond that is ignored. That is rarely an issue for typical passwords, but it matters if you hash long passphrases or other data. For signing messages with a secret key rather than storing passwords, an HMAC generator is the right tool. And however well a site hashes, a weak password is still guessable, so test yours with the password strength checker.

Common uses

  • Creating a bcrypt password hash for a database seed script, fixture or admin user
  • Checking whether a plaintext password matches a stored hash while debugging a login
  • Testing how a different cost factor changes the hash and the time it takes
  • Confirming a hash created by another language, such as a PHP $2y$ hash, verifies correctly
  • Learning how salting and key stretching work without writing any code

For more hashing, encoding and token utilities, browse all security tools.

Bcrypt terms explained

TermWhat it means here
BcryptA password hashing function from 1999, based on the Blowfish cipher, designed to be slow and to embed its own salt
Salt16 random bytes generated for every hash and stored inside it, so identical passwords produce different hashes
Cost factor (salt rounds)The number in the hash, such as 10 in $2a$10$. The work done is 2 to the power of this number
$2a$ / $2b$ / $2y$Version prefixes of the bcrypt format. This tool creates $2a$ hashes and can check all three
Key stretchingMaking a hash deliberately expensive so each password guess costs an attacker real time
Compare (verify)Re-hashing a candidate password with the salt and cost read from a stored hash, then checking the two match

Frequently Asked Questions

Reviewed by Raja Jahangir · Last reviewed: October 7, 2026

How do you generate a bcrypt hash?

To generate a bcrypt hash, enter the text, set the salt rounds (cost factor) anywhere from 4 to 14, and click Generate. Each run produces a different 60-character hash starting with $2a$ because a fresh random salt is embedded. Switch to compare mode to test text against an existing hash. Hashing runs in the browser using bcryptjs.

Why does the same password give a different bcrypt hash every time?

Bcrypt generates a random 16-byte salt each time and stores it inside the hash, so hashing the same password twice produces two different 60-character strings. Both are valid: verifying a password reads the salt and cost from the stored hash and recomputes it. That is why bcrypt hashes are checked with a compare function, never by string equality.

Sources and standards