About the Bcrypt Hash Generator tool
bcrypt is a password hashing function designed to be slow on purpose. Each hash includes a random salt and a cost factor, so identical passwords produce different hashes and attackers cannot use precomputed tables. It is the default in frameworks such as Laravel, Ruby on Rails and Spring Security, and is available in Django and most Node.js authentication libraries. This tool lets you create and check bcrypt hashes without writing code.
To generate a hash, type a password and choose a cost factor from 4 to 15; every step doubles the work, so cost 12 takes four times as long as cost 10. A fresh random salt is created with your browser’s secure random generator, the hash is computed by the bcryptjs library with a progress bar, and the result is shown split into its version prefix, cost, 22-character salt and 31-character hash. You can label the output $2b$, $2a$ or $2y$, since these variants use the same algorithm in a correct implementation.
The Verify tab checks whether a password matches an existing hash, for example one copied from a database during debugging. bcrypt only uses the first 72 bytes of the password, and the tool warns you when input is longer. All hashing happens locally, so passwords are never transmitted.
How to use Bcrypt Hash Generator
- On the “Generate hash” tab, enter the password in “Password or text to hash”.
- Drag the “Cost factor (rounds)” slider; 10 to 12 is typical for web apps.
- Choose a “Version prefix” and click “Generate bcrypt hash”.
- Copy the hash, or switch to “Verify hash”, paste a password and hash and click “Verify password”.
Features
Cost factor 4–15
Choose the work factor and see how long hashing took on your device.
Verify existing hashes
Check a password against any $2a$, $2b$ or $2y$ bcrypt hash.
Hash anatomy
The version, cost, salt and digest are colour-coded so you can read the format.
72-byte warning
Alerts you when a password is longer than bcrypt can use.
Local and private
Uses bcryptjs and the Web Crypto random generator entirely in your browser.
When to use it
- Create a hashed password to insert into a users table while seeding a database.
- Check whether a user’s stored hash matches a password during debugging.
- Generate an admin password hash for a config file or environment variable.
- Show students how salts make identical passwords hash differently.
Frequently asked questions
What cost factor should I use?
Choose the highest cost your server can afford while keeping login time acceptable, often around 250 ms per hash. For many servers that is a cost of 10 to 12; 10 is a common default.
Why does the same password give a different hash each time?
Each hash uses a new random salt, which is stored inside the hash itself. Verification reads that salt back, so any of the different hashes will still match the password.
What is the difference between $2a$, $2b$ and $2y$?
They mark revisions that fixed bugs in some older implementations. Hashes from a correct implementation are identical apart from the label; PHP writes $2y$ and most other libraries write $2b$.
Can a bcrypt hash be decrypted?
No. bcrypt is a one-way function. The only way to recover a password is to guess candidates and hash each one, which the cost factor makes deliberately slow.
Is it safe to hash a real password here?
The password never leaves your browser. Still, it is good practice to generate production credentials inside your own application or server environment.