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
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
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
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
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
| Part | In the example | Meaning |
|---|---|---|
| Version | $2a$ | The bcrypt format revision (this tool always produces 2a) |
| Cost factor | 10$ | Salt rounds; the work done is 210 = 1,024 rounds of key setup |
| Salt | Hl.4F7S9Kii/LHfVJGKD2O | 22 characters encoding 16 random bytes |
| Hash | 0vaAhxNw9.N6we7ZBBDCUAm1XSlDbV2 | 31 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 rounds | Iterations (2n) | Time relative to 10 rounds |
|---|---|---|
| 4 (minimum here) | 16 | 1/64 |
| 8 | 256 | 1/4 |
| 10 (default) | 1,024 | 1x |
| 12 | 4,096 | 4x |
| 14 (maximum here) | 16,384 | 16x |
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
| Term | What it means here |
|---|---|
| Bcrypt | A password hashing function from 1999, based on the Blowfish cipher, designed to be slow and to embed its own salt |
| Salt | 16 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 stretching | Making 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
A bcrypt generator turns a password or other text into a bcrypt hash, the salted, deliberately slow format many applications use to store passwords. This one also has a compare mode that checks whether a piece of text matches an existing bcrypt hash.
No. The tool loads the bcryptjs library into your browser and both hashing and comparing run on your device. The text and the hash are not transmitted or stored. Even so, it is good practice to use test values rather than real production passwords in any online tool.
Bcrypt creates a new random 16-byte salt for every hash and stores it inside the result, so hashing the same text twice gives two different 60-character strings. Both are valid. To verify a password, bcrypt reads the salt and cost from the stored hash and recomputes it, which is why hashes are checked with a compare function rather than by string equality.
The tool defaults to 10, and 10 to 12 is a common production choice. Each extra round doubles the time needed per hash, for you and for an attacker, so pick the highest value that keeps logins fast on your own servers. This tool accepts 4 to 14.
Switch the Mode menu to Compare text to a hash, type the password, paste the full 60-character hash and click Compare. The tool reports Match or No match. If the hash has a malformed header it reports an invalid bcrypt hash format instead.
No. Bcrypt is a one-way hash, not encryption, so there is no key that turns a hash back into the password. The only way to recover a password is to guess candidates and compare each one, which the cost factor is designed to make slow.
In a hash such as $2a$10$ followed by 53 characters, 2a is the algorithm version and 10 is the cost factor. The next 22 characters are the encoded salt and the final 31 characters are the hash itself, for 60 characters in total.
They are revisions of the bcrypt format created to fix implementation bugs in specific libraries; for ordinary passwords they produce the same result. This tool generates $2a$ hashes, and in compare mode it also accepts $2b$ and $2y$ hashes, such as those created by PHP password_hash.
Yes. Bcrypt only uses the first 72 bytes of input, so anything after that is ignored and two long passwords that share the same first 72 bytes produce matching hashes. Characters outside basic ASCII take more than one byte in UTF-8, so the limit can be reached with fewer than 72 characters.
Check that the hash was pasted completely and without extra spaces: a bcrypt hash is exactly 60 characters, and a hash of any other length, including one with a trailing space, is treated as not matching. Also check the password for stray spaces or a different letter case, since bcrypt is case sensitive.
Use bcrypt, or another dedicated password hash such as Argon2. SHA-256 is built to be fast, which lets attackers test billions of guesses per second, and it has no built-in salt. Keep SHA-256 for checksums and signatures.
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.
