Bcrypt Generator & Checker
Bcrypt Generator & Checker
Hash passwords with bcrypt and verify hashes — all client-side, cost-factor adjustable.
Bcrypt Generator Tool
7 of 72 bytes used (7 characters)
The page times each hash on your device. For scale, one measurement: on an Apple M4 Mac in Chromium 156, this page took 58 ms at cost 10, 114 ms at 11, 225 ms at 12, 450 ms at 13 and 896 ms at 14 (24 November 2026). Other devices and browsers will differ, and a server running native bcrypt is a different measurement again.
0 of 72 bytes used (0 characters)
How to use the bcrypt generator
Hash mode
Enter a password and pick the cost factor (4 to 14). Each step up doubles the work. OWASP recommends bcrypt only for legacy systems, with a cost of at least 10, and says that "as a general rule, calculating a hash should take less than one second". The count under the field shows how many of bcrypt's 72 bytes the password uses, and the page shows how long your device took.
Read the hash
The output is a 60-character string such as $2a$10$…: the version, the cost, a 22-character salt and the 31-character hash, in bcrypt's own radix-64 alphabet. PHP's password_verify(), Node's bcrypt libraries and others read it directly.
Verify mode
Paste a hash and a candidate password. The cost and salt are read from the hash itself, the password is hashed again with them, and the tool tells you whether it matches. Hashes starting $2a$, $2b$ or $2y$ (the PHP prefix) are accepted. The page runs bcrypt in this tab, so it checks hashes up to cost 14; a higher cost would freeze the tab, and the page says so instead of running.
Note the same-password-different-hash rule
bcrypt adds a random 128-bit salt to every hash, so hashing the same password twice gives two different strings, and both verify. Only the first 72 bytes of a password count; the tool counts them as you type and warns you if yours is longer.
bcrypt — the password-storage standard that has aged well
bcrypt is a password-hashing function published by Niels Provos and David Mazières at the 1999 USENIX conference (Provos and Mazières, USENIX 1999). It was designed for OpenBSD to make each password guess deliberately expensive, and to let that expense rise as hardware gets faster, through a single cost parameter.
How it works
bcrypt is built on the Blowfish cipher. Its "EksBlowfish" key schedule mixes in a 128-bit salt and the password, then repeats the expensive part 2cost times, so cost 10 means 1,024 rounds and each step up doubles the work. The resulting state encrypts the 192-bit text "OrpheanBeholderScryDoubt" 64 times, and the output is stored with the version, cost and salt in one string. Verifying a password repeats exactly the same steps with the stored cost and salt.
"For legacy systems using bcrypt, use a work factor of 10 or more and with a password limit of 72 bytes." OWASP Password Storage Cheat Sheet
The 72-byte limit
The original paper describes passwords of up to 56 bytes, a count that includes the terminating zero byte; common implementations, including the bcryptjs library this page uses, read up to 72 bytes and ignore the rest. A 77-byte password verifies against the hash of its first 72 bytes.
The limit is in UTF-8 bytes, not characters. A Chinese, Japanese, Korean or Thai character takes 3 bytes, so 24 of them fill the window; an emoji takes 4, so 18 do. The cut can also land inside a character. Type "a" and then 24 copies of 密: byte 72 falls inside the last 密, and only its first 2 bytes are read. 富 starts with the same 2 bytes, so the same password ending in 富 gives the same hash. The count under the password field shows where your password stands.
OWASP says to "enforce a maximum password length of 72 bytes (or less if the bcrypt implementation in use has smaller limits)". It calls pre-hashing a longer password "dangerous" because of null bytes in the hash output and password shucking, and where it is done gives the form bcrypt(base64(hmac-sha384(data:$password, key:$pepper)), $salt, $cost), with the pepper stored outside the database. NIST SP 800-63B-4 pulls the other way: verifiers "SHOULD permit a maximum password length of at least 64 characters", counted as Unicode code points, and "SHALL verify the entire submitted password (e.g., not truncate it)". Sixty-four Chinese characters are 192 bytes, more than bcrypt reads (NIST SP 800-63B-4, §3.1.1.2).
Prefixes
You will see $2a$, $2b$ and $2y$ at the start of bcrypt hashes. They mark versions of the algorithm and its implementations; PHP's password_hash(), for example, "will produce a standard crypt() compatible hash using the $2y$ identifier", according to the PHP manual. Since PHP 8.4 its default bcrypt cost is 12, up from 10. This page produces $2a$ hashes and verifies all three prefixes.
bcrypt, Argon2 and PBKDF2
For new systems OWASP recommends Argon2id, a variant of Argon2 (Argon2 won the 2015 Password Hashing Competition), with at least 19 MiB of memory, 2 iterations and 1 degree of parallelism; scrypt if Argon2id is unavailable; bcrypt for legacy systems; and PBKDF2 with HMAC-SHA-256 and at least 600,000 iterations where FIPS-140 compliance is required. Whatever you use, hash passwords on the server: hashing in the browser, as this teaching tool does, exposes the password to anything else running on the page.
How bcrypt works, its 72-byte limit and what OWASP recommends now
bcrypt was published by Niels Provos and David Mazières at the 1999 USENIX Annual Technical Conference.
Each password gets a random 128-bit salt, so the same password never hashes to the same string twice.
The expensive step runs 2cost times: cost 10 is 1,024 rounds, and each step up doubles the work.
The final state encrypts the 192-bit text "OrpheanBeholderScryDoubt" 64 times.
Common implementations use only the first 72 bytes of a password; the paper itself describes 56, counting the terminating zero byte.
OWASP recommends bcrypt only for legacy systems, at a cost of 10 or more.
For new systems OWASP recommends Argon2id, a variant of Argon2; Argon2 won the 2015 Password Hashing Competition.
Where FIPS-140 compliance is required, OWASP points to PBKDF2-HMAC-SHA-256 with at least 600,000 iterations.
PHP's password_hash() writes the $2y$ prefix; its default cost rose from 10 to 12 in PHP 8.4.
A bcrypt hash is 60 characters: version, cost, 22-character salt and 31-character hash.
Frequently asked questions
Method & sources
How it computes
Hashes with self-hosted bcryptjs 2.4.3 (genSaltSync(cost), hashSync, compareSync) at cost 4-14, and verifies 60-character $2a$, $2b$ and $2y$ hashes up to cost 14. Counts the password's UTF-8 bytes as it is typed against the 72 bcrypt reads, the limit OWASP gives and this build applies (a 77-byte password verifies against the hash of its first 72), and says when byte 72 falls inside a character.
What this tool implements
- Verifies 60-character $2a$, $2b$ and $2y$ hashes; $2y$ is the prefix PHP's password_hash writes, so PHP and Laravel hashes verify here. A pasted hash above cost 14 is refused rather than run: bcryptjs runs in the page, and each step of cost doubles the work.
- The 72-byte window is counted in UTF-8 bytes, and characters as Unicode code points as NIST SP 800-63B-4 counts them. A Han, kana, Hangul or Thai character is 3 bytes, so 24 fill the window. When byte 72 falls inside a character only its first bytes count: 'a' followed by 24 × 密 verifies against the same password ending in 富, which shares 密's first two bytes. Checked against the bcryptjs build the page runs.
- OWASP: bcrypt for legacy systems at a work factor of 10 or more with a password limit of 72 bytes, and calculating a hash "should take less than one second". OWASP calls pre-hashing "dangerous" (null bytes in the hash output, password shucking) and gives the form bcrypt(base64(hmac-sha384(password, pepper)), salt, cost), the pepper kept out of the database.
- OWASP: Argon2id for new systems (19 MiB, t=2, p=1), Argon2 having won the 2015 Password Hashing Competition; PBKDF2-HMAC-SHA-256 at 600,000+ iterations for FIPS. Construction per Provos and Mazières (128-bit salt, 2^cost rounds, 'OrpheanBeholderScryDoubt' encrypted 64 times; the paper's 56-byte limit counts the terminating zero byte); PHP 8.4 raised its default cost to 12.
- NIST SP 800-63B-4 §3.1.1.2: verifiers SHOULD permit a maximum password length of at least 64 characters and SHALL verify the entire submitted password, not a truncation of it. 64 Han characters are 192 bytes, more than bcrypt reads.
- Timings: the page reports the reader's own time for each hash. The one reference it prints was measured on this page on 24 Nov 2026, Apple M4 Mac, Chromium 156: 58, 114, 225, 450 and 896 ms at cost 10 to 14 (median of three runs; one run at 13 and 14).
Sources
- Provos N, Mazières D. A Future-Adaptable Password Scheme. Proceedings of the FREENIX Track, 1999 USENIX Annual Technical Conference. https://www.usenix.org/legacy/events/usenix99/provos/provos.pdf
- OWASP. Password Storage Cheat Sheet. https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_C…
- NIST. SP 800-63B-4: Digital Identity Guidelines, Authentication and Authenticator Management, §3.1.1.2 Password Verifiers. 2025. https://pages.nist.gov/800-63-4/sp800-63b/authenticators/#passwor…
- PHP Manual. password_hash (PASSWORD_BCRYPT, $2y$ identifier; default cost 12 from PHP 8.4). https://www.php.net/manual/en/function.password-hash.php