Bcrypt Hash Generator
Hash a password with bcrypt at the cost factor you choose, or check whether a password matches an existing bcrypt hash. Runs in your browser.
Input
Output
Readme
What is bcrypt?
Bcrypt is a password hashing function designed to be slow, so that someone who steals a database of password hashes can't try billions of guesses per second. Each hash includes a random salt, so two people with the same password get different hashes, and a cost factor that sets how much work one hash takes. Many web frameworks use bcrypt for storing passwords, including Laravel, Ruby on Rails, Django (as an option) and Spring Security.
Generating a hash
- Type the password.
- Pick a cost factor.
- Click Generate hash and copy the result.
Each step up in the cost factor doubles the time a hash takes. A cost of 10 to 12 is common today; the tool shows how long the hash took on your device, so you can pick a cost your server can afford for every login. Because the salt is random, generating again gives a different hash, and every one of them matches the password.
Checking a password
Switch to Verify, type the password and paste the bcrypt hash, then click Check password. The tool tells you whether they match and shows the hash's version and cost factor.
Reading a bcrypt hash
A hash like $2b$12$ followed by 53 characters has four parts:
2bis the version.$2a$,$2b$and$2y$hashes work the same way for passwords, and the tool checks all three.12is the cost factor.- The next 22 characters are the salt.
- The last 31 characters are the hash itself.
The 72-byte limit
Bcrypt only uses the first 72 bytes of a password and ignores the rest. Letters with accents and other non-English characters take two or more bytes each. The tool warns you when a password is longer than that, because any password that starts with the same 72 bytes would match too.
How it works
Hashing runs with the bcrypt.js library in a background worker, so the page stays responsive even at high cost factors. Your passwords and hashes stay in your browser and are never uploaded.
Features
- Generate bcrypt hashes at the cost factor you choose
- Check a password against a $2a$, $2b$ or $2y$ hash
- See the version and cost factor of a hash
- See how long a hash takes on your device
- Warning for passwords past the 72-byte limit
- Runs in your browser