Bcrypt Hash Generator

Bcrypt is a password hashing function with a work factor, not a general-purpose digest. Each hash embeds its own salt and cost so two identical passwords never look the same on disk. OWASP still lists bcrypt as acceptable when you cannot run Argon2. Raise the cost until hashing takes hundreds of milliseconds on your hardware.

Storing passwords in your own app? Check new ones the way NIST asks, in the browser and on your server: add the password field SDK.

What the bcrypt hash generator is for

Bcrypt exists to be slow. General-purpose hashes like SHA-256 are designed for speed, which is a catastrophe for stored passwords — a modern GPU can test billions of SHA-256 guesses per second against a stolen database.

Bcrypt adds a tunable cost factor and a built-in random salt, so each guess takes real time and identical passwords produce different hashes. That converts an afternoon's cracking into something computationally impractical.

Common uses

  • Generating a test hash while building a login system
  • Verifying that an existing bcrypt hash matches a candidate password
  • Demonstrating why cost factors matter during a code review or training session
  • Producing a seed administrator hash for a fresh deployment

What the output means in the real world

The output is a Modular Crypt Format string starting with $2a$, $2b$, or $2y$, including algorithm, cost, salt, and digest. Store that entire string in the user row. At login, pass the plaintext and this string into a bcrypt verify function; do not re-hash and string-compare yourself. Never email the hash as if it were a password.

How this fits into real work

Credential dumps that used unsalted SHA-1 fall in hours. Bcrypt dumps still fall if the cost is 4 and the password is 'Welcome1'. Cost 12 on modern CPUs is a common floor; re-hash on login when you raise it.

Some ORMs silently truncate bcrypt inputs at 72 bytes. A long passphrase can collide with a shorter prefix. If you accept passphrases, hash a SHA-256 of the input first or document the 72-byte cap.

Verifying on this page is for fixtures and incident work. Production verification belongs in your application with constant-time library code, not a copy-paste from a browser.

How to use this tool

  1. Enter the password you want to hash.
  2. Choose a cost factor. Ten is a common default; twelve is a stronger modern choice. Each step doubles the work.
  3. Generate the hash and note the format — algorithm, cost, salt, and digest are all encoded in the one string.
  4. To check a password, paste an existing hash into the verify field along with the candidate password.

Tips

  • Never pick a cost so high that logins become slow for users; measure it on your production hardware and aim for roughly 250ms.
  • Bcrypt silently truncates input beyond 72 bytes. For long passphrases, pre-hash with SHA-256 or choose Argon2 instead.
  • You never need to store a salt separately — it is already inside the hash string.

Privacy & how it works

Everything happens inside your browser. The values you type are held in page memory only, are never sent to a server, and disappear when you close the tab. You can confirm this in your browser's network tab: the only request a tool makes is one that names the tool for a usage count, with nothing you typed in it. The tools also work with the internet disconnected. Hashing runs in the browser via the bcryptjs library. Even so, never paste a real production password into any web tool, including this one.

Frequently asked questions

What cost factor should I use?
Twelve is a reasonable default in 2026. The right answer is whatever keeps verification around 250 milliseconds on your own servers — measure rather than guess.
Why does the same password give a different hash each time?
Bcrypt generates a fresh random salt per hash. That is deliberate: it stops attackers precomputing tables and hides the fact that two users chose the same password.
Is bcrypt still recommended, or should I use Argon2?
Both are acceptable. Argon2id is the current OWASP first choice because it also resists memory-hard attacks, but well-configured bcrypt remains perfectly respectable and is more widely supported.

Browse other tools

All tools run entirely in your browser — nothing you type is sent to a server, except the optional HIBP 5-character hash prefix.