More
More
Bcrypt Generator & Verifier
Hash a password with bcrypt or check one against a hash.
Free tools that run in your browser. Nothing you type, open or create is uploaded to NerdBible or anyone else.
Hashing runs in a background worker in your browser using bcryptjs (BSD licence), so nothing you type is sent anywhere and the page stays responsive at high cost factors. Hashes start with $2b$, the current version, and are accepted by PHP password_verify, Node bcrypt, Python bcrypt, Spring Security and most other libraries. For real accounts, your application should hash passwords on its own server; use this page for testing, migrations and checking a hash.
How to use it
- Type a password and pick a cost factor. 10 to 12 suits most web applications today.
- Press Hash it. The salt is random, so the same password gives a different hash every time.
- To check a password, open Check a password, paste the hash and the password, and press Check.
Questions
Why is the hash different every time?
bcrypt mixes a new random 16 byte salt into every hash and stores it inside the hash string. That stops attackers using precomputed tables, and the salt is read back when you verify, so every one of those hashes still matches the password.
Which cost factor should I use?
Pick the highest your server can afford: one hash should take roughly 100 to 300 milliseconds. Each step up doubles the work, so cost 12 takes four times as long as 10. The timer here shows how long it took on your device.
Is there a length limit?
Yes. bcrypt only uses the first 72 bytes of the password. Longer passwords are cut off, so two that share the same first 72 bytes match each other. The page warns you when that happens. Accented letters and emoji take more than one byte each.
What do $2a$, $2b$ and $2y$ mean?
They are versions. $2a$ is the original, $2y$ is PHP's fixed version and $2b$ is the current one. They produce the same result for normal passwords, and most libraries accept all three.
About this tool
About the bcrypt generator
bcrypt is one of the standard ways to store passwords. Unlike a plain SHA or MD5 hash, it is deliberately slow and adds a random salt to every hash, so stolen hashes cannot be guessed at billions per second or looked up in precomputed tables.
Two modes
- Hash a password: type it, choose a cost factor and press Hash it. The result starts with $2b$, the current version, and works with PHP password_verify, Node and Python bcrypt libraries, Spring Security and most others.
- Check a password: paste a hash and a password to see whether they match, which is useful when debugging a login.
Choosing a cost factor
Each step up doubles the work. Pick the highest your server can afford, aiming for roughly 100 to 300 milliseconds per hash; 10 to 12 suits most web applications today. The page times each hash on your device, which gives a rough guide.
Things that surprise people
The same password gives a different hash every time, because the salt is random and stored inside the hash; verification still works. bcrypt also reads only the first 72 bytes of a password, and the page warns you when a longer one is cut.
Hashing runs in a background worker in your browser, so nothing you type is sent anywhere. Real applications should hash on their own server.
Related tools
- Hash Generator & File ChecksumSHA and MD5 hashes of text or files, HMAC signatures, and checking a download against its published checksum.
- Password GeneratorStrong random passwords, passphrases and custom random strings, made on your device.
- RSA Key Pair GeneratorPublic and private keys, generated in your browser.
- JWT Decoder & EncoderRead a JSON Web Token, check an HS256 signature or sign a test token.