Bcrypt Hash Generator — Free Online Bcrypt Tool
Password security starts with how you store passwords. Storing plain-text passwords is a critical vulnerability; even basic MD5 or SHA-1 hashes are dangerously fast to brute-force with modern GPUs. Bcrypt is the industry-recommended algorithm specifically designed for password hashing, and our free online bcrypt generator lets you create and verify real bcrypt hashes instantly in your browser.
What Is Bcrypt?
Bcrypt is a password-hashing function designed by Niels Provos and David Mazières in 1999, based on the Blowfish cipher. It was specifically engineered to be slow and computationally expensive, making brute-force and dictionary attacks impractical even with modern hardware.
Three properties make bcrypt the right choice for password hashing:
1. Adaptive Cost Factor (Work Factor)
Bcrypt includes a configurable cost factor (also called rounds or work factor). This determines how many iterations of the Blowfish key schedule are applied. Each increment doubles the computation time. As hardware gets faster, you can increase the cost factor to maintain security without changing your application code.
| Cost Factor | Approximate Hashing Time | Use Case |
|---|---|---|
| 10 | ~100ms | Development/testing |
| 12 | ~400ms | Recommended for production |
| 14 | ~1,600ms | High-security applications |
| 16 | ~6,400ms | Extremely sensitive data |
2. Built-In Salting
Bcrypt automatically generates a unique, random 22-character salt for each hash. This salt is stored as part of the hash string itself — in the prefix. Two hashes of the same password will always be different because they have different salts. This eliminates pre-computation attacks like rainbow tables entirely.
3. Fixed Output Length
Regardless of the password length, a bcrypt hash is always exactly 60 characters in the standard $2b$xx$... format. This makes database storage simple and predictable.
Anatomy of a Bcrypt Hash
A bcrypt hash string has a well-defined structure:
$2b$12$LQv3c1yqBWVHxkd0LHAkCOYz6TtxMQJqhN8/LewdykzO8s9FNV2G
Breaking this down:
| Part | Value | Meaning |
|---|---|---|
$2b$ | Algorithm identifier | bcrypt version (2b is current standard; 2a is legacy) |
12 | Cost factor | 2¹² = 4,096 iterations |
LQv3c1yqBWVHxkd0LHAk | Salt (22 chars) | Random salt in modified Base64 |
COYz6TtxMQJqhN8/LewdykzO8s9FNV2G | Hash (31 chars) | Blowfish hash output |
How to Use the Bcrypt Generator
- Enter the password or text you want to hash in the input field
- Select a cost factor — 12 is recommended for most production applications
- Click Generate Hash. The tool loads the
bcryptjslibrary (a pure JavaScript implementation) and computes a real bcrypt hash - The hash appears in the output field — copy it directly into your database or application config
Verifying a Hash
The tool also includes a hash verifier:
- Enter the original password in the password field above
- Paste the bcrypt hash in the “Verify Hash” field
- Click Verify — the tool will confirm whether the password matches the hash
This uses the same bcryptjs library to perform a real bcrypt compare operation in your browser.
Note: The bcrypt library is loaded from a CDN on first use. Higher cost factors (14, 16) can take several seconds to compute — this is intentional and is what makes bcrypt secure.
Why Not MD5 or SHA-1 for Passwords?
MD5 and SHA-1 are general-purpose cryptographic hash functions designed to be fast. A modern GPU can compute billions of MD5 hashes per second. This makes brute-force attacks against MD5-hashed password databases trivially fast.
Bcrypt’s intentional slowness means even at 100,000 guesses per second (generous for bcrypt-12), a 10-character random password would take centuries to crack by brute force. OWASP, NIST, and every major security standard recommend bcrypt, Argon2id, or scrypt for password hashing. MD5 and SHA-1 are explicitly blacklisted for passwords.
OWASP Password Storage Recommendations
According to OWASP (Open Web Application Security Project):
- Use Argon2id (preferred if available), bcrypt, or scrypt for password hashing
- Use a minimum cost factor of 10 for bcrypt (12 or higher recommended)
- Always use unique salts (bcrypt handles this automatically)
- Never use MD5, SHA-1, SHA-256, or any general-purpose hash without a salt and key stretching
Our generator uses real bcrypt conforming to all of these requirements.
Frequently Asked Questions
Is this generating real bcrypt hashes?
Yes. This tool uses the bcryptjs npm library (loaded from esm.sh), which is a pure JavaScript implementation of the real bcrypt algorithm. The hashes it produces are fully compatible with bcrypt implementations in Node.js (bcrypt, bcryptjs), Python (passlib, bcrypt), PHP (password_hash), Go (golang.org/x/crypto/bcrypt), and all other standard bcrypt libraries.
What cost factor should I use for production?
OWASP recommends a minimum of 10. 12 is the most common production recommendation — it’s slow enough to resist brute force but fast enough that login requests in a web app (which hash your password to verify it) complete in under a second.
Why does hashing take several seconds for high cost factors?
This is by design. Bcrypt’s slowness is a security feature. Each increment in the cost factor doubles the computation time, making parallel brute-force attacks increasingly impractical. At cost 16, a GPU would need to check billions of guesses one-by-one at 6+ seconds each.
Can I verify a bcrypt hash from my app with this tool?
Yes. Enter the original plaintext password in the password field and the hash from your database in the Verify field. The tool will perform a real bcrypt compare. This is useful for debugging auth issues or confirming a hash was stored correctly.
Is my password sent anywhere?
No. The bcrypt hashing runs entirely in your browser using JavaScript. Your password and the hash are never transmitted to any server. No logs. No analytics on input. 100% client-side.
What’s the difference between $2a$ and $2b$ prefixes?
$2a$ is an older bcrypt version with a bug in handling non-ASCII characters (characters with byte values > 127). $2b$ is the corrected version. For ASCII passwords (letters, numbers, symbols), both produce correct results. Always prefer $2b$ in new systems. Our tool generates $2b$ hashes.