PK Systems PK Systems
Encoders & decoders

bcrypt Hash Generator & Verifier

Hash passwords with the industry-standard bcrypt and verify a plain password against any bcrypt hash. Adjustable cost.

bcrypt Hash Generator & Verifier

Cost is logarithmic: each step doubles the work. 10 is a safe modern default; 12 for sensitive systems.

bcrypt hash


        
    

What is bcrypt?

bcrypt is a password-hashing function designed by Niels Provos and David Mazières in 1999. It builds on the Blowfish cipher and is deliberately slow: a configurable cost factor controls how many key-setup rounds run before the hash is produced, so defenders can keep raising the cost as hardware speeds up. Each hash also embeds a 128-bit random salt, which means hashing the same password twice produces two different outputs and pre-computed rainbow tables are useless. The output looks like $2b$10$… where 2b is the algorithm version, 10 is the cost factor and the rest is the salt and hash. bcrypt remains the workhorse choice for password storage in 2026: simpler to use than Argon2, more battle-tested than scrypt, and supported in every major language.

How to use

To hash, type the password, pick a cost factor and click Generate hash. The output goes straight to your database. To verify, paste the hash from the database and type the candidate password, then click Verify. Bcrypt embeds the cost factor inside the hash, so you don’t pick it again on verify — the library reads it from the string.

Choosing a cost factor

Each cost step doubles the time. Pick the highest cost that keeps logins under ~250 ms on your hardware. For high-traffic logins on commodity servers, 10 (≈60 ms) is the modern minimum; 12 (≈250 ms) is a comfortable choice for sensitive accounts; 13–15 is justified for crown-jewel credentials but you must measure latency. Increase the cost when you upgrade the database — re-hash on the next login.

Cost factor reference (modern CPU, single thread)

Cost Iterations Approx. time
416~1 ms
8256~15 ms
10 (default)1,024~60 ms
124,096~250 ms
138,192~500 ms
1416,384~1 s
1532,768~2 s

Frequently asked questions

Is bcrypt still safe in 2026?
Yes. bcrypt with cost ≥10 remains a perfectly acceptable password hash. Argon2id is the OWASP first choice for new projects, but bcrypt is fine, well-supported and easy to audit.
Where is the salt?
The salt is encoded inside the hash itself, between the cost factor and the digest. The library extracts it during verification — you never store the salt separately.
What’s the maximum password length?
Most bcrypt implementations silently truncate the password at 72 bytes. Pre-hash long passwords (e.g. SHA-256) and base64 the result, or use Argon2 if you need to support arbitrarily long passwords.
Why is the high-cost run slow?
By design. The whole point of bcrypt is to make brute-force attacks expensive. To keep the page responsive, this tool runs costs ≥12 in a Web Worker so your browser stays usable.
Are $2a$, $2b$ and $2y$ different?
$2a$ is the original (with a known PHP-era bug for 8-bit chars), $2b$ is the corrected version used everywhere today, and $2y$ is a PHP-specific tag pinned to the bug-free behaviour. The verifier accepts all three.
Does the page send my password anywhere?
No. Both hashing and verification run entirely on your device. Your password, hash, and verification result never leave the page, never travel to our servers, and are not stored, indexed, logged, or shared.