By Tim King · Updated
Bcrypt Cost Benchmark
How Many Bcrypt Rounds Fit Your Login Delay Target
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Bcrypt Cost Benchmark works
This bcrypt cost benchmark hashes a test password at each cost factor in a range, times every run and recommends the highest cost that stays under your target delay. Use it to pick a work factor that slows down attackers without making your own logins sluggish.
How to read the bcrypt cost benchmark
Each step up in bcrypt cost doubles the work, so cost 12 takes about twice as long as cost 11. The benchmark runs the costs in order and stops early once a run takes more than twice your target, since higher costs would only be slower. The recommendation is the highest cost that finished within the target.
The timings come from a JavaScript bcrypt in your browser. Native libraries on a server are usually two to four times faster, so the recommended cost is a lower bound: your server can often afford one step more. OWASP recommends a cost of at least 10, and a target between 100 and 500 milliseconds per login suits most sites. Re-run the numbers on your production hardware before changing the setting.
FAQ
What bcrypt cost should I use?
Start at 10 or higher and raise it until hashing takes around 250 milliseconds on your server. Many frameworks default to 10 or 12. Higher is safer against offline cracking but each login and signup costs that much CPU, so busy sites should weigh throughput too.
Can I change the cost for existing passwords?
Yes. The cost is stored inside each hash, so old hashes keep verifying. When a user logs in successfully, rehash their password at the new cost and save it. Most libraries offer a needs-rehash check to make this a single line.
Should I use Argon2 instead of bcrypt?
For new systems, OWASP prefers Argon2id because it is memory-hard and resists GPU cracking better. Bcrypt is still acceptable and widely supported. Note that bcrypt only uses the first 72 bytes of a password, which matters for long passphrases.
See also: all Security & Identifiers tools, Dev Utilities, Formatters & Validators, Data & Encoding, SEO, Accessibility, AI.
Related tools
Bcrypt Generator
Generate and verify bcrypt password hashes.
Password Hash Generator
Argon2id, scrypt and PBKDF2 password hashes with OWASP defaults.
Password Hash Identifier
Identify bcrypt, Argon2, sha512crypt, NTLM, MD5 and other hash formats.
Password Policy Tester
Test a list of passwords against length, character and banned-word rules.
.env File Checker
Lint a .env file for syntax errors, duplicates and weak secrets.