Bcrypt Generator & Checker: Hash and Verify Passwords
Generate a bcrypt hash with cost 4 to 18 or check whether a password matches a $2a$, $2b$ or $2y$ hash. Runs in your browser; nothing is uploaded.
Updated November 2026
Reviewed by Rafael Duarte
Local Benchmark
Processing time on your current hardware
Implementation Snippets
const bcrypt = require('bcryptjs');
const SALT_ROUNDS = 12; // OWASP minimum is 10; 12 is a common default
async function hashPassword(plaintext) {
return await bcrypt.hash(plaintext, SALT_ROUNDS);
}
async function verifyPassword(plaintext, hash) {
return await bcrypt.compare(plaintext, hash);
}
const hash = await hashPassword('user_password');
// '$2b$12$...' (60 chars, always different due to random salt)
const isValid = await verifyPassword('user_password', hash);
// trueHow this bcrypt hash generator works
At the default cost of 12, a hash takes well under a second
1. Paste your password
Type it into Input Password. Hashing runs in your browser; open the DevTools Network tab if you want to see for yourself that nothing is sent.
2. Adjust the cost factor
Slider from 4 to 18 — defaults to 12; OWASP asks for a minimum of 10.
3. Generate and copy
The hash appears with the exact time it took on your hardware; copy it with one click.
What this bcrypt tool does
Beyond just generating the hash
Verifies an existing hash
The Verify Hash tab checks a password against a $2a$, $2b$ or $2y$ hash and shows Match or No Match. At cost 12 that takes a fraction of a second.
Benchmarks the cost factor
The Local Benchmark measures the real hashing time at cost 8, 10, 12 and 14 on your own hardware, not a generic estimate.
Breaks down the generated hash
The generated hash is broken apart into labeled version, cost, salt, and checksum pieces, each with an explanation.
Ready-made code snippets
Generates equivalent hashing and verification code for Node.js, Python, PHP, Go, Java, Ruby, C#, and Rust.
100% client-side with bcryptjs
No password ever leaves your browser — confirm it yourself in the DevTools Network tab.
Examples
The same password never produces the same hash twice
When you'll reach for a bcrypt generator
The most common scenarios among people who use this tool
Authentication
Hash passwords before storing them; bcrypt.compare() confirms the match in constant time at login.
Migrating off a weak algorithm
Progressively re-hash MD5 or SHA-1 passwords to bcrypt the next time each user logs in successfully.
Calibrating the cost factor
Run the benchmark on production-equivalent hardware to find the highest cost that stays under your UX threshold.
Security audits
Use the Verify tab to check whether a stored hash matches the expected password — its prefix already shows version and cost.
Check this before shipping to production
Cost 4–8 in production
These finish in a few milliseconds up to the low tens of milliseconds, which gives little resistance to brute force. Use cost 10 as an absolute minimum and 12 as the default.
Hashing an already-hashed hash
Produces a string that can never be verified again. Always hash the original plaintext password, never a previous hash.
The 72-byte limit
Bcrypt silently truncates anything past 72 bytes — cap the length in bytes or switch to Argon2id (SHA-256 pre-hashing has known pitfalls).
Storing the salt separately
Unnecessary — bcrypt already embeds the salt inside the hash's 60 characters, so a separate salt column just adds complexity.
Why generate bcrypt hashes here
All hashing runs in your browser with bcryptjs, a pure JavaScript implementation — open DevTools and confirm the Network tab stays empty while you type.
The benchmark measures real time on your own hardware instead of a generic estimate, and ready-made snippets for eight languages skip the step of writing the library call by hand.
Bcrypt vs. Argon2id
Both solve password hashing; pick based on your project
Frequently asked questions
No. Bcrypt is a one-way hash, not encryption, so there is nothing to decrypt. What you can do is check a guess: open the Verify Hash tab, paste the password and the hash, and click Verify Match. For a deeper look at why, see how to actually protect passwords.
Paste it into the Verify Hash tab as is. PHP's password_hash() writes $2y$, which is equivalent to $2b$, and the tool accepts $2a$, $2b$ and $2y$. Old $2x$ hashes are not supported.
OWASP sets a minimum cost of 10 and says to go as high as your server allows; 12 is a common starting point, targeting roughly 250ms per hash. Use this page's benchmark to measure your own server and pick the highest cost that stays under your UX threshold (300ms–1s).
No. Bcrypt is a one-way function — the only way to recover a password is brute force, and the deliberately high iteration count makes that expensive. At cost 12, each attempt takes around 250ms, so testing billions of guesses is impractical.
$2a$ is the original 1999 prefix. $2b$ (OpenBSD, 2014) fixed a bug where passwords longer than 255 bytes had their length wrapped, and is today's standard. The 8-bit character bug belonged to crypt_blowfish (PHP): $2x$ marks old affected hashes and $2y$ the fixed ones, equivalent to $2b$.
It only processes the first 72 bytes of input — everything after that is silently ignored, not rejected. If your users can create longer passphrases, enforce a byte limit or use Argon2id, which has no length cap; pre-hashing with SHA-256 has known pitfalls (e.g. null bytes) and should only follow OWASP's guidance.
OWASP recommends Argon2id as the first choice for new systems — it's memory-hard, which makes it far more resistant to GPU and ASIC cracking, and has no password length limit. Bcrypt with cost 12 or higher remains sound for systems already built on it.
Use the Verify Hash tab above: paste the plaintext password and the stored hash, and bcryptjs runs the comparison entirely in your browser. Nothing is sent over the network. Even so, prefer test passwords over real user credentials when you can.
References
Related article
Password hashing: bcrypt, scrypt, and Argon2
Related Tools
- Caesar Cipher Wheel: Encode, Decode & Brute Force Developer Encode or decode on an interactive Caesar cipher wheel, crack an unknown shift with all 25 brute-force results and frequency analysis. ROT13 included.
- Chmod Calculator: Linux Permissions 755, 644 & 777 Developer Tick read, write and execute or type 755 to get rwxr-xr-x, a ready chmod command and a warning for 777. Includes umask, SUID, SGID and sticky bit.
- Enigma Machine Simulator: M3 & M4 Emulator Online Developer Encrypt and decrypt like a WWII operator: Enigma M3 and M4, rotors I–VIII, ring settings, a 10-cable plugboard and a step-by-step signal animation.
- Hash Generator Online — MD5, SHA-1, SHA-256, SHA-512 Developer Generate MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 hashes instantly in your browser. Free online hash tool — no install, no sign-up, 100% client-side.
- JWT Decoder Online — Decode & Verify JSON Web Tokens Developer Decode and inspect JSON Web Tokens instantly — view header, payload, verify HMAC signatures, and generate JWT code in PHP, JavaScript, Python, and Java.