How to use the Bcrypt Generator
- 1
Type the password
The text you want to hash.
- 2
Choose the cost factor
Higher is slower and stronger; 10–12 is typical.
- 3
Generate the hash
The 60-character bcrypt string, with timing.
- 4
Or verify
Paste a hash and a password to check whether they match.
Features
Bcrypt hashing
Salted, slow, one-way.
Adjustable cost
See how long each cost takes.
Verification
Check a password against any bcrypt hash.
Prefix choice
$2b$, $2a$ or PHP’s $2y$.
WebAssembly
Fast enough for high costs.
Private
Nothing leaves your browser.
Who uses it — and for what
Developers
Seed test users and fixtures.
Admins
Reset a password directly in a database.
Debugging
Check why a login fails.
Learning
See salts and costs in action.
What is bcrypt?
Bcrypt is a password-hashing function designed to be slow on purpose. Each hash includes a random 16-byte salt, so identical passwords produce different hashes, and a cost factor that doubles the work for every step — cost 10 means 2¹⁰ = 1,024 rounds of key expansion. A hash looks like $2b$10$ + 22 characters of salt + 31 characters of hash. Laravel, Ruby on Rails, Django (optional), Spring Security and many Node.js apps use it to store passwords.
Choosing a cost
Pick the highest cost your login server can afford — hashing should take roughly 100–300 ms. Cost 10–12 is typical in 2026; the timer shows how long it took on your device. $2a$, $2b$ and $2y$ are the same algorithm for normal passwords; PHP’s password_hash() writes $2y$. Bcrypt uses only the first 72 bytes of a password, so very long passphrases are truncated — the tool warns you. For new systems, Argon2id is the modern recommendation.
Everything is computed by your browser’s built-in Web Crypto API — keys, passwords and secrets are never sent to a server, logged or stored. You can even disconnect from the internet after the page has loaded.
Cost factor and time
Each step up in cost doubles the work: cost 11 takes about twice as long as cost 10, cost 12 about four times. The aim is a hash that takes roughly a quarter of a second on your login server — fast enough for users, painfully slow for an attacker trying billions of guesses. Measure on your real server, because a laptop browser and a small cloud VM can differ a lot.
Bcrypt, Argon2 or PBKDF2?
| Algorithm | Strength | Notes |
|---|---|---|
| Argon2id | Best current choice | Memory-hard; recommended by OWASP for new systems |
| bcrypt | Strong, widely supported | Only the first 72 bytes of a password are used |
| scrypt | Strong | Memory-hard |
| PBKDF2 | Acceptable with high iterations | Needed for FIPS compliance |
| MD5 / SHA-1 / SHA-256 | Not for passwords | Far too fast to resist cracking |
Worked examples
Reading a bcrypt hash
$2b$10$ + 22 characters of salt + 31 characters of hash. $2b$ is the version, 10 the cost (2¹⁰ = 1,024 rounds of key expansion), and the rest encodes the salt and result.
Pro tips
- Never hash passwords with plain SHA-256 or MD5.
- Most frameworks (Laravel, Django, Spring, Rails) handle bcrypt for you — use their built-in functions.
Glossary
- Salt
- Random data added to each password before hashing.
- Cost factor
- How many rounds bcrypt performs, as a power of two.
- One-way function
- Easy to compute, practically impossible to reverse.
Frequently asked questions
Can a bcrypt hash be decrypted?
No. It is one-way; you can only check whether a guessed password produces the same hash.
Why is my hash different every time?
A new random salt is generated each time. Verification still works because the salt is stored inside the hash.
What cost should I use?
Usually 10–12; increase it as servers get faster.
Why is bcrypt limited to 72 bytes?
It is a design limit of the algorithm; longer passwords are truncated.
Are $2a$ and $2b$ hashes compatible?
For normal passwords, yes — most libraries verify both.
Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of Security & Privacy (20 tools)