bcrypt Generator
Hash passwords with bcrypt at a chosen cost, and check a password against an existing bcrypt hash.
Runs in your browser. Nothing is uploaded.
Generate a hash
Only the first 72 bytes are used; the rest is ignored by bcrypt.
Check a password
How to use the bcrypt Generator
- To hash, type a password, choose a cost factor and press Generate hash.
- To check, enter a password and an existing bcrypt hash, then press Check.
- The hash's version and cost are shown as soon as you paste it.
- Copy the generated hash into your database seed, config or test.
- Load example fills in a matching password and hash.
Hash and check passwords with bcrypt
Applications must never store passwords as plain text, or even as fast hashes like SHA-256. If a database leaks, fast hashes can be cracked by the billion per second. bcrypt is built to be slow and salted, which makes each guess expensive. Developers use this tool to create test users, seed databases, migrate accounts, and check whether a password matches a stored hash while debugging a login.
Generate
Choose a cost factor between 4 and 15. The tool estimates how long each hash takes. Higher is safer but
slower, and every step doubles the work. The result is a standard 60-character string such as
$2b$12$…, containing the version, the cost, the 22-character salt and the 31-character hash. It works
with bcrypt libraries in every major language.
Check
Paste a stored hash and a candidate password to see whether they match. The tool reads the version and cost from the hash, re-hashes the password with the same salt, and compares the result. It’s handy for confirming test credentials, or checking that a migrated hash still works.
Runs in the background
bcrypt is deliberately slow, so hashing runs in a background worker and the page never freezes, even at cost 15, which can take several seconds. Everything happens on your device, so passwords are never sent anywhere. For generating strong passwords in the first place, use the Password Generator.
Frequently asked questions
What is bcrypt?
bcrypt is a password-hashing function designed to be slow. It mixes a random salt into every hash and repeats its work 2^cost times, so each guess costs an attacker real time. It has protected passwords since 1999 and is still a solid choice.
Which cost factor should I use?
The highest your server can afford while keeping logins fast, typically 10–12 in 2026. Each step doubles the time per hash. Aim for roughly 100–300 ms per hash on your production hardware, and raise the cost as hardware gets faster.
Why does the same password give a different hash every time?
Each hash includes a new random salt, stored in the hash itself (the 22 characters after the cost). That's intentional. It stops attackers from using precomputed tables and from seeing which users share a password. Checking reads the salt back from the hash.
What does $2a$, $2b$ or $2y$ mean?
They're version markers. $2b$ is the current standard. $2a$ and $2y$ come from older or PHP implementations and are generally compatible for checking.
Is there a password length limit?
Yes. bcrypt uses only the first 72 bytes of a password, and the tool warns when you go past that. Long passphrases are still fine, as long as their first 72 bytes are strong.
Tutorials
How to check a password against a bcrypt hash
Confirm whether a password matches a stored bcrypt hash when debugging a login, and read the hash's cost and version.