Bcrypt Generator: How to Hash and Verify Passwords the Right Way
Learn how to use the Bcrypt Generator to create secure password hashes with an adjustable cost factor, and verify existing hashes β all client-side in your browser.
Table of Contents
If you are building any application with user accounts, plain-text passwords should never touch your database. Bcrypt remains one of the most battle-tested algorithms for password hashing, and it has quietly protected billions of accounts since 1999. The Bcrypt Generator on Online Tools Forge lets you generate and verify bcrypt hashes directly in your browser β no server round-trip, no installation, and zero risk of leaking your password to a third party.
Unlike general-purpose hash functions such as MD5 or SHA-256, bcrypt was designed specifically for passwords. It is deliberately slow, it salts every hash automatically, and its cost factor scales with hardware improvements. In this guide, you will learn how the tool works, what the cryptic $2b$10$... string actually contains, and how to choose a cost factor that balances security against login latency.
Why Use Bcrypt?
- Built-in salting. Every bcrypt hash embeds a random salt, so identical passwords produce completely different hashes. This defeats rainbow tables and makes precomputation attacks impractical.
- Adaptive cost factor. The work factor (4β15 in this tool) lets you tune how slow hashing is. As CPUs and GPUs get faster, you raise the cost and stay ahead of brute-force attackers.
- Purpose-built for passwords. Fast hashes like MD5 and SHA-256 are optimized for throughput β exactly what an attacker wants. Bcrypt's key setup based on Blowfish makes each guess expensive by design.
- Proven at scale. Bcrypt has been reviewed by cryptographers for over two decades and is the default password hasher in frameworks like Laravel, Rails (has_secure_password), and many Node.js stacks.
- Self-contained hash strings. The algorithm, cost, and salt all live inside the hash string itself (e.g. $2b$10$N9qo8u...), so verification needs no extra metadata β just the stored string.
- 100% client-side processing. This tool runs bcryptjs in your browser. Your password never leaves your machine, which makes it safe even for testing with real credentials.
Key Features
| Feature | What it does |
|---|---|
| Generate Hash | Turn any password into a full bcrypt hash with your chosen cost factor |
| Verify Password | Check a password against an existing $2a$/$2b$/$2y$ hash |
| Cost factor selector | Choose a work factor from 4 to 15 (default 10) |
| Variant support | Handles $2a$, $2b$, and $2y$ hash formats |
| Copy to clipboard | One-click copy of the generated hash |
| Client-side only | Runs entirely in your browser via bcryptjs β nothing is uploaded |
- The two-tab layout mirrors real-world workflows: you either hash a new password before storing it, or verify a candidate password against a hash you already have.
- The cost selector updates instantly, so you can feel the difference between cost 10 (snappy) and cost 14 (visibly slower) before committing to a value in production.
- Hash format validation catches typos early β the verifier expects a string starting with $2a$, $2b$, or $2y$.
How to Use
- Open the Bcrypt Generator.
- In the Generate Hash tab, type the password you want to hash.
- Pick a cost factor. Start with 10 for interactive logins; use 12+ for high-value accounts.
- Click generate, then copy the resulting $2b$... string to your clipboard for storage.
- Switch to the Verify Password tab any time you need to confirm a password matches a stored hash β paste the hash, enter the candidate password, and check the result.
Understanding Bcrypt
Anatomy of a hash string
A bcrypt hash looks like this:
$2b$10$N9qo8uLOjkA3BbZGM4gMfep7hVScfFLbrktA7qfnG.xJxSVCoqr1u
Breaking it down:
- $2b$ β the algorithm version identifier
- 10 β the cost factor (2^10 = 1,024 key expansion rounds)
- The next 22 characters β the base64-encoded random salt
- The remaining 31 characters β the derived hash of the password
Because the salt and cost are embedded in the string, verification is completely self-contained. You store one string, and that is everything bcrypt needs later.
Cost factor benchmarks
The cost factor is an exponent: each increment doubles the computation time. On typical 2026 hardware, single-threaded hashing lands roughly at:
| Cost | Rounds | Approximate time per hash |
|---|---|---|
| 10 | 1,024 | ~60β100 ms |
| 12 | 4,096 | ~250β400 ms |
| 14 | 16,384 | ~1β2 s |
Cost 10 is the widely accepted minimum today. Cost 12 is a common choice for production web apps, and 14+ suits credentials worth extra protection β keeping in mind that your users wait out this delay at every login attempt.
$2a$ vs $2b$ vs $2y$
These prefixes mark historical bug-fix revisions of the algorithm. $2a$ is the original OpenBSD specification. $2b$ fixed an edge-case overflow bug found in some 2014 implementations and is what current libraries generate. $2y$ was a PHP crypt() marker that behaves like $2a$. For practical purposes, all three verify identically in modern libraries β the tool accepts any of them, which matters when you import legacy user databases.
Why not MD5 or SHA-256?
A modern GPU can compute billions of MD5 hashes per second, turning a leaked database into a crackable dataset within hours. bcrypt's cost 12 limits the same hardware to a few thousand guesses per second per core β a gap of many orders of magnitude. If you need a general-purpose checksum, use our hash generator instead; reserve bcrypt strictly for passwords.
Practical Use Cases
Prototyping an authentication flow
Before wiring up a full backend, you can pre-generate bcrypt hashes for seed users and paste them straight into a migration file or fixtures. The verify tab then lets you confirm the seeded credentials work β all without standing up a server.
Verifying hashes from a production database
Debugging a "wrong password" report? Copy the stored hash (read-only, no sensitive plaintext involved in the hash itself), paste it into the verify tab together with the password the user claims, and immediately see whether the mismatch is in the hash or elsewhere in your auth pipeline.
Migrating legacy systems
Importing users from an older PHP or Python app often means a pile of $2a$ or $2y$ hashes. Testing that your new verification path handles all three variants correctly is a two-minute job with this tool instead of a deploy-test-deploy loop.
Learning and teaching
If you are studying password security or preparing a workshop, nothing beats watching cost 10 versus cost 14 hash the same password at visibly different speeds. It turns an abstract security concept into something you can feel.
Best Practices
- Never store plain-text passwords. Hash at registration, verify at login β there is no legitimate reason to know a user's actual password.
- Default to cost 12 for new apps. It keeps login under half a second on modern servers while staying far ahead of GPU cracking rigs. Re-evaluate yearly.
- Always let bcrypt generate the salt. Rolling your own salt logic is a classic source of vulnerabilities β the library's automatic 128-bit salt is better than anything hand-rolled.
- Use a unique salt per password. Bcrypt does this by default, which is why two identical passwords hash differently.
- Don't reuse verification code paths for other algorithms. Keep bcrypt for passwords and dedicated checksum tools for file integrity.
- Test with throwaway passwords only. Even though this tool is fully client-side, making a habit of never typing production credentials into any web tool is good hygiene.
Start Hashing Securely
Password security is one of the few areas where doing the right thing is genuinely easy β as long as you reach for the right algorithm. The Bcrypt Generator gives you production-grade bcrypt hashing and verification with zero setup, running entirely on your own machine. Try it with a cost factor of 12 and see how a deliberate slowdown is exactly what keeps your users safe.
Related Tools You Might Like
- Password Hash Verifier β check passwords against a wider range of hash formats
- Password Strength Checker β evaluate password quality before you hash it
- Hash Generator β MD5, SHA-1, SHA-256 and more for checksums and signatures
Happy hashing!