Every system that lets people log in faces the same problem: it has to recognise a returning user's password without keeping that password written down anywhere. Storing passwords as plain text means one leaked database hands an attacker every account at once. Storing them with a fast hash such as SHA-256 is barely better, because a fast hash can be guessed at enormous speed.

bcrypt exists to close that gap. It is deliberately slow, and it mixes a fresh random salt into every hash, so each result is unique even when two people pick the same password. This guide walks through the full round trip with the free bcrypt Hash Generator on Ovatly: hash a password at cost 10, store the string it gives you, and later check a typed password against that string.

Contents

  • Quick answer
  • Why passwords are hashed, not stored or encrypted
  • What the stored string actually contains
  • How to hash a password and check it later, step by step
  • Worked example: hashing a four-word passphrase
  • Why the second hash looks completely different
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Open the bcrypt Hash Generator, type the password, set the cost factor to 10, and generate the hash. Copy the single string it produces and store that string, never the password; the typed password is never transmitted anywhere. Later, paste the stored hash into the verify section, type the password again, and the tool answers match or no-match. If you hash the same password twice and get two completely different strings, nothing has gone wrong: a fresh random salt is used on every run, and verification extracts that salt from the stored hash automatically.

Why passwords are hashed, not stored or encrypted

A hash is a one-way fingerprint. There is no key and no way to run it backwards, so a stored hash does not hand the password to anyone who reads it. The only way to test a guess is to hash the guess and compare, which is precisely what a legitimate login does.

That is also why speed is a weakness here. A fast hash lets an attacker test guesses in huge numbers. bcrypt is built to be slow, and its cost factor sets how slow, so each guess carries a real price in time. The salt completes the defence: because every hash uses a different random salt, precomputed rainbow tables of common passwords are useless, since the same password never hashes the same way twice.

What the stored string actually contains

A bcrypt result is a single string that carries everything verification needs: the algorithm version, the cost factor, the salt, and the hash itself. That is why storing passwords with bcrypt means storing one string per user, not a separate salt column and hash column that have to be kept in sync.

It also means the string is safe to store as it stands. The password cannot be read out of it, and the salt sitting inside it in plain view is not a leak: the salt's job is uniqueness, not secrecy.

How to hash a password and check it later, step by step

  1. Open the bcrypt Hash Generator and enter the password or text you want to hash.
  2. Set the cost factor. Cost 10 is the classic default. The tool offers 4 to 12 and warns at 11 and 12, because higher costs can freeze a browser tab while they run.
  3. Click Generate bcrypt hash and copy the result.
  4. Store that string wherever your system keeps credential records. Store the hash, not the password, and note that the password you typed was never transmitted anywhere.
  5. Later, to check a login attempt: open the verify section, paste the stored hash, type the password being tested, and run the check.
  6. Read the verdict. Match means the typed password is the one that produced the hash. No-match means it is not, or that the hash string itself is damaged, because a malformed hash is treated as a simple no-match.

Worked example: hashing a four-word passphrase

Hashing the passphrase "correct horse battery staple" at cost 10 produced this result in one run:

$2b$10$jT61zASMuZO.BYMYrC8tVOrG4f70YI6WdfYJA2RvF4xQe9jYzcUa.

Read it in parts. The opening marks it as a bcrypt hash. The 10 is the cost factor used. The long remainder is the salt and the hash combined, which is why verification later needs nothing except this string and the password being tested.

Run the same passphrase through the bcrypt Hash Generator yourself and you will get a different string. That is expected, and the next section explains why it still works.

Why the second hash looks completely different

Every run generates a fresh random salt. Change the salt and the entire output changes, even though the password and the cost are identical. Two hashes of one password therefore share nothing visible except the format and the cost.

Verification copes with this because it never compares two hashes directly. It reads the salt out of the stored hash, runs the typed password through bcrypt with that same salt and cost, and compares the outcome. Same salt, same password, same result: match. This is also why you should never try to check a password by hashing it again and comparing strings; always use the verify check against the stored hash.

Limitations and honest tradeoffs

bcrypt truncates its input at 72 bytes. Anything past that point in a longer password is ignored, so two passwords that share the same first 72 bytes would verify as the same password. For ordinary passwords this never matters, but it is a real property of the algorithm, not a bug in the tool.

The cost range in this tool runs from 4 to 12. Production systems commonly pick a cost between 10 and 13, tuned so one check takes roughly 250 ms on their own server, and they re-tune as hardware improves. A browser tool caps the range lower because a heavy cost can freeze the tab you are working in.

A verify verdict also has a blind spot: a malformed or damaged hash returns the same no-match as a wrong password, so the check cannot tell you which of the two went wrong. And while bcrypt is still widely used and acceptable, newer systems often choose Argon2id instead, for its memory hardness and resistance to GPU-based guessing. Finally, never substitute a fast hash such as SHA-256 for password storage; speed is the opposite of what this job needs.

Common mistakes

  • Storing the password next to the hash, just in case. That defeats the entire point. The hash alone is enough to check logins forever.
  • Hashing twice and comparing the strings. Fresh salt makes every hash different. Always verify against the stored hash instead.
  • Reading a no-match as proof the password was wrong. A damaged or truncated hash string produces the same verdict. Check the stored string is complete before blaming the user.
  • Picking a cost by copying someone else's number. Cost is a timing decision for your hardware. Real applications tune it so one check takes roughly 250 ms on the production server.
  • Using bcrypt where a fast hash belongs, or the reverse. File checksums want speed; password storage wants slowness. Swapping them weakens both jobs.

FAQs

Why does the same password produce a different hash every time? Because a fresh random salt is mixed in on every run. The salt is stored inside the resulting hash string, so the two results look completely different while both still verify against the same password.

How do I check a password against a bcrypt hash later? Paste the stored hash into the verify section, type the password, and run the check. Verification extracts the salt from the stored hash automatically and answers match or no-match. Nothing is decrypted.

What cost factor should I use? Cost 10 is the classic default and a sensible starting point. Real applications tune the cost so one check takes roughly 250 ms on the production server, which commonly lands between 10 and 13. This tool offers 4 to 12 and warns at 11 and 12, because higher costs can freeze a browser tab.

Can a bcrypt hash be reversed back into the password? No. A bcrypt hash cannot be decrypted or run backwards. The only way in is guessing the password and checking the guess, and the cost factor makes every guess expensive, which is exactly the protection.

What happens if I paste a damaged or incomplete hash into the verify section? It is treated as a simple no-match. The verify check does not report a separate error for a malformed hash, so a no-match can mean a wrong password or a damaged hash string.

Conclusion

The round trip is short: hash at cost 10 with the bcrypt Hash Generator, store the one string, and verify against it later. The salt makes every hash unique, the cost makes guessing expensive, and the password itself is never stored or sent anywhere. If you want to understand the cost number before you settle on one, read our explainer on what the bcrypt cost factor changes. For more guides in this series, see our Security and Privacy guides.

References