T
THINKFORU
Submit Feedback

Bcrypt Generator & Verifier: Cost Factor & Salt

Bcrypt Generator & Verifier: Cost Factor & Salt
Bcrypt Generator
● LOCAL ONLY
🔒 Zero Data Storage: All bcrypt hashing and verification runs in your browser in plain JavaScript, and the Web Crypto API only generates random salts. Your password and hashes never leave your device. Read our Zero Data Storage Policy →

Inputs are stored after the # in the link, which browsers do not send to the server. By default the password is left out, so share it separately.

Modern Security & Hashing Utilities

Bcrypt Cost Factor Reference

Cost factorSample hashRounds (2^cost)Hash lengthGuidance
Cost 4$2b$04$N9qo8uLOickgx2ZMRZoMyeSuVmV5MQilj2yZi38Fq2CCnx12jZvOG1660 charsLowest cost bcrypt allows. Tests only.
Cost 6$2b$06$N9qo8uLOickgx2ZMRZoMyecNJ9D49QG/aJWR5Ul8TcPVXdNe2noe66460 charsFar too weak for real passwords.
Cost 8$2b$08$N9qo8uLOickgx2ZMRZoMyehegLkueuZfNporHcbOHvlYvKCZTRnLW25660 charsStill below the OWASP minimum.
Cost 10$2b$10$N9qo8uLOickgx2ZMRZoMye8fOsiTWZqYtkxvXkKm8BMzjT7t/vIdq1,02460 charsOWASP minimum work factor for bcrypt.
Cost 12$2b$12$N9qo8uLOickgx2ZMRZoMye67UrYIsXzjoqhdj1feUwR5GOflRtAs24,09660 charsCommon modern default for new systems.
Cost 14$2b$14$N9qo8uLOickgx2ZMRZoMyezTxMIe3BaLdRUA4K73.23qkvmygcy6y16,38460 charsStrong, but slow on weak servers and phones.

Sample inputs for all rows: password password salt N9qo8uLOickgx2ZMRZoMye version $2b$. A bcrypt hash is always 60 characters: $2b$ + cost + $ + 22-character salt + 31-character hash. OWASP lists Argon2id first and accepts bcrypt for legacy systems at cost 10 or higher with a 72-byte password limit.

Bcrypt Test Vector Dataset (13 Vectors & Standards)

Reference vectors, version prefixes and edge cases. Click Copy next to any hash. Paste it into the verify field above with the matching password to check your implementation. Every hash was cross-checked against the Python bcrypt library.

Identifier / Standard NameSample Bcrypt HashUnderlying AlgorithmTechnical Specs / InputsHash Length
1. Reference Vectors (Openwall crypt_blowfish test suite)
Openwall TC1$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeWbcrypt ($2a$)Password "U*U"; Cost 5 (32 rounds); Salt CCCCCCCCCCCCCCCCCCCCC.; Version $2a$60 chars
Openwall TC2$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwKbcrypt ($2a$)Password "U*U*"; Cost 5 (32 rounds); Salt CCCCCCCCCCCCCCCCCCCCC.; Version $2a$60 chars
Openwall TC3$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4abcrypt ($2a$)Password "U*U*U"; Cost 5 (32 rounds); Salt XXXXXXXXXXXXXXXXXXXXXO; Version $2a$60 chars
2. Version Prefixes ($2a$, $2b$, $2y$ share the same algorithm)
$2b$ (current standard)$2b$10$N9qo8uLOickgx2ZMRZoMye8fOsiTWZqYtkxvXkKm8BMzjT7t/vIdqbcrypt ($2b$)Password "password"; Cost 10 (1,024 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$; only the prefix differs, the salt and hash body are identical60 chars
$2a$ (legacy)$2a$10$N9qo8uLOickgx2ZMRZoMye8fOsiTWZqYtkxvXkKm8BMzjT7t/vIdqbcrypt ($2a$)Password "password"; Cost 10 (1,024 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2a$; only the prefix differs, the salt and hash body are identical60 chars
$2y$ (PHP crypt_blowfish)$2y$10$N9qo8uLOickgx2ZMRZoMye8fOsiTWZqYtkxvXkKm8BMzjT7t/vIdqbcrypt ($2y$)Password "password"; Cost 10 (1,024 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2y$; only the prefix differs, the salt and hash body are identical60 chars
3. Edge Cases
Empty password$2b$05$N9qo8uLOickgx2ZMRZoMyejxU1jBu6pWeger6d/WObW2aydZVCQWubcrypt ($2b$)Password "" (0 B); Cost 5 (32 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$; empty input is allowed by bcrypt, never by policy60 chars
Single-character password$2b$05$N9qo8uLOickgx2ZMRZoMye.M5ygHRwqnv9X15EQ6PkCF6WlGGPTfabcrypt ($2b$)Password "a"; Cost 5 (32 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$60 chars
72-byte password (limit)$2b$05$N9qo8uLOickgx2ZMRZoMyeL8MQLYEOYsM9jiqHXKMlhJsNVJcTfkGbcrypt ($2b$)Password "a" x72 B; Cost 5 (32 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$; exactly the bcrypt limit60 chars
73-byte password (truncated)$2b$05$N9qo8uLOickgx2ZMRZoMyeL8MQLYEOYsM9jiqHXKMlhJsNVJcTfkGbcrypt ($2b$)Password "a" x73 B; Cost 5 (32 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$; byte 73 is ignored, so this equals the 72-byte result60 chars
Unicode password (UTF-8)$2b$05$N9qo8uLOickgx2ZMRZoMyeFyQKUeqYvkpKiFI59R5PFHfQ0AfEW56bcrypt ($2b$)Password "passw-umlauts-accents" UTF-8 encoded (14 B); Cost 5 (32 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$; accented characters use 2 bytes each60 chars
Minimum cost 4, all-dots salt$2b$04$......................LAtw7/ohmmBAhnXqmkuIz83Rl5Qdjhmbcrypt ($2b$)Password "password"; Cost 4 (16 rounds); Salt ......................; Version $2b$; lowest cost bcrypt accepts60 chars
Hash of a long passphrase$2b$10$N9qo8uLOickgx2ZMRZoMyehtJ/whDdsI.d1w/JqKiOrDw8pCT0JLGbcrypt ($2b$)Password "correct horse battery staple"; Cost 10 (1,024 rounds); Salt N9qo8uLOickgx2ZMRZoMye; Version $2b$60 chars

FAQ

What bcrypt cost factor should I use?

OWASP advises a work factor of at least 10 for systems that use bcrypt, together with a 72-byte password limit. Every extra point of cost doubles the hashing time, so pick the highest value your servers can afford, commonly 12, and raise it as hardware gets faster.

Why does bcrypt only use the first 72 bytes of a password?

The Blowfish key schedule inside bcrypt accepts at most 72 bytes of key material, so longer passwords are silently cut. UTF-8 characters can take several bytes, so the limit may arrive earlier than 72 characters. OWASP recommends enforcing the limit at input rather than relying on silent truncation.

Why is the bcrypt hash different every time for the same password?

Each hash gets a fresh random 128-bit salt, stored inside the 60-character string as $2b$ + cost + $ + 22 salt characters + 31 hash characters. To verify a password you re-hash it with the salt and cost read from the stored hash and compare, you never compare two independently generated hashes.