What Is bcrypt?
What is bcrypt and why do password hashers use it?
bcrypt is a password-hashing algorithm that combines a random salt with an adjustable work factor to make each hash slow to compute. Slow hashing means an attacker who steals your password database cannot quickly guess the original passwords.
Why passwords need a different hash than files
SHA-256 and friends are fast by design, which is exactly what you want for checking a file or a download. But fast is fatal for passwords: a GPU can try billions of guesses a second. bcrypt flips that by being deliberately slow, so guessing every candidate is expensive.
What bcrypt actually is
bcrypt is a password-hashing function adapted from the Blowfish cipher. It takes the password plus a random salt and runs a configurable number of rounds of key stretching. The result is a 60-character string that carries everything needed to verify it later.
- Salt: random per hash, embedded in the output
- Cost factor: 2^cost rounds of key stretching
- Output: a 60-character hash string starting with $2a$10$
bcrypt vs. SHA-256
SHA-256 is fast, unsalted, and deterministic: the same input always gives the same hash. bcrypt is slow, salted, and different every run. Reach for SHA-256 when you need integrity checks on data. Reach for bcrypt when the input is a password that must survive a database leak.
Where developers use bcrypt
bcrypt is the workhorse for storing user credentials in web applications and login systems. Any place a password must be stored and later verified is a place bcrypt belongs. Because it is widely supported in every language, it is a common default choice for new projects.
Try it in your browser with our bcrypt Password Hasher. No upload, no server.
Open bcrypt Password Hasher →FAQ
Is bcrypt encryption?
No. Encryption is reversible with a key. bcrypt is a one-way hash, so you cannot decrypt a hash back into the password.
Can bcrypt be reversed?
No. It is one-way. Verification works by hashing the candidate password with the stored salt and cost, then comparing the results.
What does $2a$10$ at the start of a hash mean?
The version marker and the cost factor. $2a$ is the bcrypt variant, and 10 means 2^10, or 1,024 rounds, of key stretching were used.
Why does the same password give a different hash?
A random salt is generated for every hash and stored inside it, so identical passwords produce different outputs and reveal nothing about each other.