Bcrypt Hash Generator and Verifier
Generate a bcrypt hash with cost 4 to 15 or verify a password against a $2a$, $2b$ or $2y$ hash. Random salt, progress bar and cancel. Runs in your browser.
How to use Bcrypt Generator
- 1Choose Generate or Verify. For Generate, type a password and pick a cost (10 is the default).
- 2Press Generate hash, or paste a hash and a password and press Verify. Cancel stops a slow run.
- 3Copy or download the $2b$ hash, or read Match or No match together with the parsed version, cost and salt.
What makes it better
- Output is a standard 60-character $2b$ hash; $2a$ and $2y$ prefixes also generate and verify
- Cost from 4 to 15 with an elapsed timer, a progress bar and a Cancel button
- Verify parses the hash and shows version, cost, salt and digest, then compares in constant time
- Warns when a password is longer than bcrypt's 72-byte limit, counting UTF-8 bytes
- Random 16-byte salt from the browser's crypto generator; nothing is uploaded
About Bcrypt Generator
Bcrypt Hash Generator turns a password into a salted bcrypt hash such as $2b$10$…, and checks whether a password matches a hash you paste in. The slow key schedule runs in your browser in short slices with a progress bar and a Cancel button, and the salt comes from the browser's secure random generator. Use it to learn how bcrypt behaves or to produce test hashes for your own code.
Common uses
- Create a test hash to seed a development database or a unit test for a login flow.
- Check whether a bcrypt hash found in a config or fixture really belongs to a known password.
- See how the cost factor changes hashing time on your own machine before choosing one for a server.
- Learn what a bcrypt string contains, such as the version, the cost and the salt.
Example
Input
correct horse
Result
$2b$10$abcdefghijklmnopqrstuu23JPZtHcGhwXSF41f93o/7vBdDut3Xu
Good to know
- Example: the sample hash was made from the password correct horse at cost 10 with a fixed salt so that you can verify it. Real hashes always get a fresh random salt, so the same password gives a different hash each time.
- bcrypt reads at most 72 bytes of a password and stops at a NUL character. Anything beyond that is ignored, so hash long passphrases with a pre-hash step in your own code or choose another algorithm.
- This is a learning and testing tool. $2x$ hashes are not supported, and you should not paste real production passwords into any website, even one that works locally.
Bcrypt Generator FAQ
What cost factor should I use for bcrypt?
Pick the highest cost that keeps a login under roughly 250 to 500 milliseconds on your own server hardware. That is usually 10 or higher today. Each +1 doubles the time, so measure on the machine that will run it and revisit the value every year or two.
Is bcrypt still safe to use for passwords?
Yes, it remains acceptable: it is deliberately slow and salts every hash. OWASP prefers Argon2id where it is available, then scrypt, with bcrypt next. What you should never do is store passwords with SHA-256, MD5 or any other fast hash on its own.
Why is the 72-byte limit a problem?
bcrypt ignores every byte after the 72nd, so two long passwords that share their first 72 bytes produce the same hash. Characters outside basic English take two to four bytes each, so a 40-character password in another script can already hit the limit.
What is the difference between $2a$, $2b$ and $2y$?
They are version prefixes. $2a$ is the original, $2b$ is the current OpenBSD form that fixed a length-handling bug, and $2y$ is PHP's marker for the same fix. For ordinary passwords the digest is identical, which is why this page verifies all three.
Why is the salt in the hash string?
A bcrypt string holds the version, the cost, the 22-character salt and the 31-character digest, so verifying needs only the hash and the password. The salt is not secret. It exists so identical passwords get different hashes and precomputed tables are useless.