Hash and verify bcrypt passwords
- Free
- No sign-up
- No upload
- Works offline
Tool facts
- Price
- Free, no sign-up, no watermark
- Are files uploaded?
- No. Everything is processed in this browser, on your device.
- Offline use
- Works without a connection once this page has loaded
- Built with
- Web Crypto and bcrypt.js
- Browser
- A recent Chrome, Edge, Firefox or Safari, on computer or phone.
Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.
About Bcrypt Generator
Bcrypt Generator creates bcrypt hashes for passwords and checks whether a password matches an existing hash. Bcrypt is the slow, salted password-hashing function used by default in frameworks such as Laravel, Ruby on Rails and Spring Security and in many database systems, so this is handy for seeding a test user, resetting an admin password directly in the database or debugging a login that fails.
Choose a cost factor from 4 to 14: each step doubles the work, so cost 10 runs 1,024 rounds of the expensive key setup and cost 12 runs 4,096. The tool shows a progress bar while hashing and splits the result into its version, cost, 22-character salt and 31-character hash. Hashing uses the bcryptjs library with a fresh random salt from crypto.getRandomValues, and both the password and the hash stay on your device.
Bcrypt Generator runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.
How to use Bcrypt Generator
- Type the password under Generate hash.
- Set the Cost slider in Options; 10 to 12 is typical for web applications.
- Click Generate hash and copy the $2b$ string that appears.
- To check a password, enter it and the stored hash under Verify and click Verify. Use for verify copies the new hash there for a quick test.
Frequently asked questions
Can a bcrypt hash be decrypted?
No. Bcrypt is a one-way function, so there is nothing to decrypt. The only way to find the password is to guess candidates and hash each one with the same salt and cost, which bcrypt deliberately makes slow. To check a password, use Verify.
Why do I get a different hash each time for the same password?
Each hash includes a new random 16-byte salt, stored in the 22 characters after the cost. Verification reads the salt from the stored hash, so every one of those different hashes still matches the password.
What is the difference between $2a$, $2b$ and $2y$?
They are versions of the same algorithm. $2b$ is the current one and fixes a bug with passwords longer than 255 characters in the OpenBSD implementation; $2y$ is the name PHP uses for the corrected version. For normal passwords all three produce the same result, and this tool verifies all of them. New hashes are created as $2b$.
Which cost factor should I use?
Pick the highest cost at which hashing takes roughly 100 to 300 milliseconds on your server. That is usually 10 to 12 today. Hashing in a browser with JavaScript is slower than native code, so the times you see here are an upper estimate.
Is there a length limit?
Yes. Bcrypt only uses the first 72 bytes of the password. Characters after that are ignored, and characters outside basic Latin take 2 to 4 bytes each in UTF-8. The tool warns you when your password is longer than 72 bytes.