Bcrypt Hash Generator
Generate and verify bcrypt password hashes with an adjustable cost factor. Each generated hash uses a fresh random salt, so hashing the same password twice produces different results.
A new random 128-bit salt is generated for each hash.
Calculations run locally in your browser. Avoid entering real production passwords into online tools.
What is bcrypt?
bcrypt is an adaptive password-hashing algorithm introduced by Niels Provos and David Mazières in 1999. It is based on Blowfish and deliberately requires computational work, making large-scale password guessing more expensive than with fast hashes such as SHA-256.
bcrypt stores its algorithm version, cost factor, salt, and hash together in a 60-character string. It is intended for password storage, not general-purpose file checksums or encryption.
What is the bcrypt cost factor?
The cost factor controls the amount of work. bcrypt uses approximately 2^cost key-expansion iterations; increasing the cost by one approximately doubles the computation time. This calculator offers costs 4 through 16 to avoid excessively long browser operations.
A cost of 10 is provided as a starting point, not a universal recommendation. For a real application, benchmark the chosen cost on the authentication server and follow current password-storage guidance. Argon2id is generally preferred for new systems where available.
Understanding a bcrypt hash
A typical bcrypt hash begins with $2b$10$. The $2b$ identifies the version, 10 is the cost factor, and the remaining 53 characters contain a 22-character encoded salt and a 31-character encoded checksum. bcrypt uses its own Base64 alphabet, not hexadecimal encoding.
A random 128-bit salt makes the same password produce different hashes on separate runs. Verification uses the salt and cost embedded in the stored hash to check a password.
The 72-byte password limit
bcrypt uses at most the first 72 bytes of the password. This is a byte limit, not a character limit: non-ASCII characters can take multiple bytes in UTF-8. This calculator truncates the UTF-8 bytes to match this behavior and warns when the limit is exceeded. Different implementations may handle long passwords or preprocessing differently, so confirm compatibility with your application.
How to use the calculator
- Enter a password in the Generate hash tab.
- Choose a cost factor and select Calculate bcrypt hash.
- Copy the generated hash using the button beside the output field.
- To check a password, open Verify password, enter the password and its stored bcrypt hash, and select Verify password.
Security considerations
Hashing and verification take place in a browser Web Worker. Passwords are not submitted to a hashing server by this tool, but browser extensions, injected scripts, and compromised devices may still expose sensitive input. Do not enter real production passwords into online tools.
bcrypt is a one-way function: a stored hash cannot be decrypted to recover the original password. Attackers may still guess passwords and compare them against stolen hashes. Use unique passwords and appropriate authentication protections.
Frequently asked questions
Can a bcrypt hash be decrypted?
No. bcrypt is a one-way password hash. Passwords can only be tested against a stored hash; weak passwords may be discovered through guessing.
Why does the same password generate different hashes?
Each hash uses a new random salt. Verification extracts the original salt from the stored hash.
What does $2b$ mean?
It identifies a bcrypt hash variant. Other prefixes, such as $2a$ and $2y$, occur in existing applications.
Is bcrypt better than SHA-256 for password storage?
Yes. bcrypt is deliberately expensive to compute and includes a salt. Plain SHA-256 is too fast to use by itself for password storage.
Should I use bcrypt or Argon2id?
Argon2id is generally preferred for new password-storage systems because it is memory-hard. bcrypt remains useful for compatibility with existing systems.
Related tools
- Password generator — Create strong random passwords.
- SHA-256 hash calculator — Generate SHA-256 digests for integrity checks.
- SHA-2 hash calculator — Compare SHA-2 algorithms.
Last updated: