Bcrypt Generator

Hash a password with bcrypt, or check one against a hash.

About Bcrypt Generator

A bcrypt generator that hashes a password at the cost factor you choose, explains each part of the hash, and verifies a password against a hash in your browser.

How to use

  1. In Hash mode, type a password. The hash appears about 400 ms after you stop typing; press New salt to hash the same password again with a fresh salt.
  2. Move the Cost factor slider (4 to 16, default 10). Each step doubles the work, and the time each hash took is shown under it.
  3. Switch to Verify, paste a bcrypt hash and type the candidate password. The result reads Match or No match; a hash that is not 60 characters in the bcrypt alphabet is flagged as malformed.
  4. Every hash and each of its parts has its own Copy button.

What it does

bcrypt is a password hashing function built on the Blowfish cipher. Unlike SHA-256 it is deliberately slow, and the slowness is tunable: a cost of n means 2^n rounds of key setup, so cost 10 is 1,024 rounds and about 100 ms, cost 12 about 400 ms.

Every hash contains its own random 16-byte salt, so the same password hashes differently each time, and verification works by re-running bcrypt with the salt read from the stored hash. A hash is 60 characters:

Part Example Meaning
Version $2b$ $2a$, $2b$ and $2y$ are interchangeable modern variants
Cost 10$ log2 of the number of rounds
Salt 22 characters 128 bits in bcrypt's own Base64 alphabet (./A-Za-z0-9)
Hash 31 characters 184 bits of output
  • Hashes are produced with the bcryptjs library and start with $2b$; they verify with any bcrypt implementation (Python bcrypt, Spring Security, PHP password_verify, Go x/crypto/bcrypt).
  • bcrypt reads at most 72 bytes of the password as UTF-8. The tool shows the byte count and warns when input is longer, because bytes after the 72nd do not change the hash.
  • There is no decrypt. The only way back from a hash is to guess passwords and verify each one.

Example

password  secret
cost      10
→ $2b$10$2/DqnYq1M6b4kJdqb6Fv2e59fm0sRXGz270NMHoIDUKkKNJY5iraW
   $2b$  version
   10$   cost (2^10 = 1,024 rounds)
   2/DqnYq1M6b4kJdqb6Fv2e  salt
   59fm0sRXGz270NMHoIDUKkKNJY5iraW  hash

Privacy

Hashing and verification run in JavaScript on this page. The password and the hash never leave the page, no request is made, and nothing is stored.

Frequently asked questions

What is the difference between bcrypt and SHA-256?
SHA-256 is a fast general-purpose hash: a GPU can try billions of candidates per second, which makes it a poor choice for passwords. bcrypt is deliberately slow, tunable through its cost factor, and salts every hash on its own, so guessing a password from a bcrypt hash is thousands of times more expensive.
What cost factor should I use for bcrypt?
Pick the highest cost your login path can afford, usually 10 to 12 in 2025, which is roughly 100 to 400 ms per hash on a server CPU. Each step doubles the time. Store the cost in the hash, as bcrypt does, so you can raise it later and rehash users when they next log in.
Can bcrypt be decrypted?
No. bcrypt is a one-way function with no key, so there is nothing to decrypt. The only way to find the password is to guess candidates and run bcrypt on each, which is exactly what the cost factor makes slow.
Why is my bcrypt hash different every time?
Because each hash includes a fresh random salt, stored in characters 8 to 29 of the result. Verification reads that salt back and recomputes, so two different hashes of the same password both verify correctly.