What you can do with Bcrypt Hash Generator & Verifier
- Hash password with bcrypt
- Verify bcrypt hash
How this security utility works
Generate real bcrypt password hashes with a chosen cost factor, and verify passwords against existing bcrypt hashes.
Example input
{"password":"EasyUtils QA vector","cost":4}Example output
$2b$04$abcdefghijklmnopqrstuuftFU.DtAa27cldSe2yTHixBDSINRWuWPractical workflow
- Enter a password to hash; the field is masked and starts empty.
- Choose a cost from 4 to 15. Cost 10 is the default, and every increment roughly doubles the work.
- Wait for the local bcrypt calculation, then copy the hash or choose New Salt to create a different hash for the same password.
- Open the Verifier tab, enter a password and paste a bcrypt hash to check whether they match.
Common use cases
- Create a bcrypt hash for a test fixture that needs a standards-compatible password hash.
- Check whether a supplied password matches an existing bcrypt hash during local debugging.
- Compare how selected bcrypt cost factors affect calculation time in this browser.
Important notes and limitations
- Passwords and hashes are processed in browser memory; the password field starts empty and this tool does not save it. Inputs are limited to 4,096 characters.
- Each generated hash includes a fresh random salt, so output changes between runs even for the same password.
- Standard bcrypt uses at most 72 UTF-8 bytes of a password. Bytes beyond that limit are ignored, and multibyte characters count as multiple bytes; this tool warns when input exceeds the limit.
- Generated hashes use bcrypt's $2b$ identifier. Apache .htpasswd uses $2y$; use the linked HTPASSWD Generator for Apache-compatible entries.
- Cost values above 12 can take several seconds in a browser. The 4–15 range is provided for testing and should be selected with your server's policy in mind. The verifier rejects hashes with costs above 15 so pasted values cannot trigger unbounded browser work.
Node.js & Python bcrypt hash & verify commands
Node.js bcrypt hash generation with cost factor
node -e 'const bcrypt = require("bcryptjs"); console.log(bcrypt.hashSync("myPassword", 10))'Generates a standard $2a$ / $2b$ Bcrypt hash with salt and cost factor 10 using JavaScript.
Python bcrypt password verification
python3 -c 'import bcrypt; print(bcrypt.checkpw(b"myPassword", b"$2b$10$..."))'Performs timing-safe comparison between a plaintext password and stored bcrypt hash in Python.
Apache htpasswd bcrypt record
htpasswd -nbB 12 admin 'SecurePassword123'Creates a Bcrypt-hashed password line with cost factor 12 for web server authentication.
Bcrypt Cost Factor & Execution Benchmark Comparison
| Cost Factor (Rounds) | Salt Iterations (2^cost) | Hashing Time (Modern CPU) | Brute-force Resistance | Recommended Deployment |
|---|---|---|---|---|
| Cost 10 (Default) | 1,024 rounds | ~60 - 100 ms | Standard web security baseline | High-throughput public web apps and APIs |
| Cost 12 (Recommended) | 4,096 rounds | ~250 - 400 ms | Strong security against GPU clusters | Standard enterprise authentication, administrative logins |
| Cost 14 (High Security) | 16,384 rounds | ~1,000 - 1,500 ms | Very high resistance against ASIC crackers | Cold storage credential vaults, root administrative accounts |
| Cost 16+ (Extreme) | 65,536 rounds | ~4,000+ ms | Maximum security | Caution: Risk of DoS under high concurrent login traffic |
Bcrypt password hashing & verification troubleshooting
Silent password truncation beyond 72 bytes
Cause: The original Eksblowfish algorithm underlying Bcrypt has a hard limit of 72 bytes. Any characters beyond 72 bytes are completely ignored.
Solution: Pre-hash very long passwords with SHA-256 before passing to Bcrypt, or inform users that passwords are capped at 72 bytes.
Hash verification fails across different programming languages ($2a$ vs $2b$ vs $2y$)
Cause: PHP historically generated $2y$ to fix a sign-extension bug, while Node.js and Python use $2b$ or $2a$.
Solution: Most modern bcrypt libraries treat $2a$, $2b$, and $2y$ equivalently. If verification fails, normalize the version identifier prefix to $2b$.
Server CPU spikes to 100% during user login spikes
Cause: Cost factor set too high for server capacity (e.g. 50 concurrent logins with cost 14 consume 50 seconds of dedicated CPU core time).
Solution: Balance cost factor around 10-12 and rate-limit authentication endpoints to prevent credential stuffing CPU starvation.
Continue your workflow
- htpasswd Generator — Create Apache and Nginx compatible htpasswd basic authentication records.
- Hash Generator — Generate fast non-salted hashes for checksum verification and identifier indexing.
- Password Generator — Generate secure, high-entropy passwords before computing bcrypt hashes.
- JWT Debugger — Verify tokens used alongside password authentication in stateless web services.
Frequently asked questions
Why does the same password give a different bcrypt hash every time?
Bcrypt embeds a random salt in each hash, so every generation differs while all of them verify against the original password. That is expected, correct behavior.
Can I check if a password matches an existing bcrypt hash?
Yes. The Verifier tab compares the password against a valid 60-character $2a$, $2b$, or $2y$ bcrypt hash.
What cost factor should I use?
The generator defaults to cost 10 and allows values from 4 through 15. Higher costs increase computation time; benchmark on the system that will verify the hashes before choosing a production setting.
Does bcrypt use a password longer than 72 bytes?
Standard bcrypt uses only the first 72 UTF-8 bytes, so any additional bytes do not affect the hash or verification. Multibyte characters count as multiple bytes, and this tool warns when either password field exceeds the limit.