Bcrypt Hash Generator — Salted Password Hashing
Securely hash passwords with an adjustable cost factor — bcrypt's built-in salt and deliberate slowness defeat rainbow tables and brute-force attacks.
What is Bcrypt Hash?
Securely store passwords with a hash that's deliberately slow to compute and includes automatic salting — this is called "bcrypt". Resistant to brute-force attacks.
Bcrypt is a password-hashing function based on the Blowfish cipher, designed specifically for securely storing passwords — the default choice for web applications because it's deliberately slow and salts every hash automatically. Unlike fast hash functions like SHA-256, bcrypt is intentionally slow; that slowness, powered by the Blowfish key schedule, makes brute-force cracking thousands of times costlier than with MD5 or SHA-256, and each hash gets a unique 16-byte salt to defeat rainbow tables. Use this tool to hash a password with an adjustable cost factor. Everything runs in your browser via the bcryptjs library, so passwords never leave your device.
Zero-Server Tool Data Guarantee
All hashing happens locally in your browser. Your password is never sent to any server.
How to Use
Hash or Verify
Use Hash to generate a bcrypt hash for a password, or Verify to test a candidate password against an existing $2a$/$2b$/$2y$ hash.
Input Your Password
Enter the password you want to hash or verify. The tool uses the bcrypt algorithm for high security.
Adjust Cost Factor
Select the number of rounds (cost factor, 8–14). Higher rounds increase security but take longer to compute.
Copy the Hash
Once generated, the hash is displayed. Use the copy button to save it for your database or application.
Common Use Cases
Password Storage
The primary use case — hash user passwords before storing them in your database. Even if your DB is leaked, passwords remain protected.
API Key Hashing
Store API keys as bcrypt hashes. Your application can verify a presented key against the hash without ever storing the plaintext.
Passphrase Verification
Verify master passwords or encryption passphrases against a stored bcrypt hash during unlock flows.
Legacy Migration
If you're migrating from MD5 or SHA-based password storage, re-hash all passwords with bcrypt on next login.
Implementation Examples
const bcrypt = require('bcryptjs');// Hash a passwordconst hash = await bcrypt.hash('mySecurePassword', 12);// "$2a$12$LJ3m4ys3Lk0TSw..."// Verify a passwordconst isMatch = await bcrypt.compare('mySecurePassword', hash);console.log(isMatch); // true
Bcrypt vs Scrypt vs PBKDF2
| Feature | Bcrypt | Scrypt | PBKDF2 |
|---|---|---|---|
| Algorithm basis | Blowfish | Memory-hard | Hash iteration |
| Memory hardness | Low (4KB) | Configurable (high) | None |
| GPU/ASIC resistance | Moderate | High | Low |
| Max input size | 72 bytes | Unlimited | Unlimited |
| Built-in salt? | Yes (auto) | No (provide your own) | No (provide your own) |
| Speed on modern CPU | ~100ms (rounds=12) | Configurable | Configurable |
Production Best Practices & Security
Frequently Asked Questions
Existing MD5 or SHA-256 hashes cannot be converted to Bcrypt — they use fundamentally different algorithms.
Instead, implement a lazy migration. When a user next logs in, verify their password against the old hash, then immediately re-hash it with Bcrypt and store the new hash. For users who haven't logged in recently, require a password reset.
Store a migration flag (e.g., version=2) alongside the Bcrypt hash to track which users have been migrated. This avoids forcing an immediate mass password reset.