Bcrypt Generator

Generate bcrypt password hashes with a cost factor you choose, and verify a password against an existing hash. Everything runs locally in your browser.

Generate a hash

Higher is stronger but slower. 12 and above get slow in the browser.


Verify a password

Why bcrypt beats a fast hash

A password store should be slow to attack, not fast to compute. General-purpose hashes like MD5, SHA-1 and SHA-256 are built for speed, so a modern GPU can test billions of candidates a second against a stolen database. Bcrypt flips that: its work factor (the cost) forces a deliberate amount of computation per hash, and you raise it as hardware gets faster. That single knob is what keeps a leaked table from being cracked overnight.

Reading the hash

A bcrypt hash is one self-describing string, for example $2b$10$N9qo8uLOickgx2ZMRZoMye.... Split on the dollar signs and it reads:

  • $2b$ - the algorithm and version tag.
  • 10 - the cost factor, meaning 2^10 = 1024 key-setup rounds.
  • The next 22 characters - the random salt, base64-encoded.
  • The final 31 characters - the hash of your password with that salt.

Because the salt lives inside the string, you never store it separately, and verification needs nothing but the hash and the password to check.

Choosing a cost factor

Cost 10 to 12 is the usual server-side range. Every increment doubles the work, so going from 10 to 13 makes each hash roughly eight times slower. Aim for a cost where a single hash takes somewhere around 100 to 250 milliseconds on your production hardware: slow enough to blunt brute force, fast enough that logins stay snappy. This page runs in JavaScript, which is slower than a native library, so cost 12 and up will feel sluggish here even though a real server would breeze through them.

For non-password hashing, reach for the SHA hash generator instead. If you are debugging auth tokens, the JWT decoder and JWT generator are close companions.

Frequently asked questions

What is bcrypt and why use it for passwords?
Bcrypt is a password-hashing function built on the Blowfish cipher. Unlike fast hashes like MD5 or SHA-256, it is deliberately slow and its cost is tunable, so an attacker who steals your database cannot try billions of guesses per second. It also folds a random salt into every hash, so two identical passwords produce different hashes.
What do the parts of a bcrypt hash mean?
A hash like $2b$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZ has four parts. $2b$ is the algorithm version, 10 is the cost factor (2^10 = 1024 key-expansion rounds), the next 22 characters are the base64-encoded salt, and the final 31 characters are the actual hash. The whole string is self-contained, so verification needs only the hash and the candidate password.
What cost factor should I use?
A cost of 10 to 12 is the common default for server-side hashing in 2024. Each step up doubles the work: 10 is about 1024 rounds, 12 is about 4096. Higher is more resistant to brute force but slower to compute. In this browser tool, 12 and above take noticeably longer because JavaScript is slower than a native server library.
Is my password sent anywhere?
No. Both generating and verifying run entirely in your browser using the bcryptjs library. Nothing you type is uploaded or logged. Even so, treat any hash you paste from a real system as sensitive.
Why does the same password give a different hash each time?
Because bcrypt generates a fresh random salt for every hash. The salt is stored inside the hash string itself, so verification still works. This is a feature: it means two users with the same password do not share a hash, defeating precomputed rainbow-table attacks.