Bcrypt Generator and Hash Checker
Hash a password with bcrypt at a cost factor from 4 to 14, or check whether a password matches an existing bcrypt hash. Hashing uses the bcryptjs library.
Higher rounds = stronger security but slower hashing. 12 is the recommended default.
Runs in your browser: your files and text are not uploaded. Free, no account needed.
Last updated: · Reviewed by the QuickTooly Team
Reading a bcrypt hash
Every hash from this tool is 60 characters long and looks like $2b$12$ followed by 53 more characters:
- $2b$ is the bcrypt version. Hashes made elsewhere may start with
$2a$or$2y$; the checker accepts all three. - 12 is the cost factor. The work doubles with each step, so cost 13 takes about twice as long as cost 12.
- The next 22 characters are the salt: 16 random bytes from the browser's
crypto.getRandomValues. A new salt is made for every hash, so hashing the same password twice gives two different results. Both still verify. - The last 31 characters are the hash itself.
Choosing a cost factor
The tool defaults to 12 and offers 4, 6, 8, 10, 11, 12, 13 and 14. Pick the highest cost your login server can afford on every sign-in, then test it on that server. After you hash, the time that hash took on this device is shown next to the cost. bcryptjs in a browser is slower than a native bcrypt library, so measure again on your server. Costs 4 to 8 are only useful for test fixtures.
The 72-byte limit
bcrypt reads at most 72 bytes of the password and ignores the rest without warning. Two long passphrases that share the same first 72 bytes produce matching hashes. Characters outside ASCII take 2 to 4 bytes each in UTF-8, so the limit can be reached with fewer than 72 characters. Spaces count too: the tool hashes exactly what you type, including leading and trailing spaces.
Frequently Asked Questions
Why does the checker say "does not match" for a hash I know is right?
A bcrypt hash must be exactly 60 characters. If a character was lost or a space was added when you copied it, the check returns no match rather than an error. Also check for a space at the end of the password.
When do I see "Invalid hash format"?
When the 60 characters do not start with a known version ($2a$, $2b$ or $2y$) followed by a two-digit cost, for example a SHA-256 hex string or an Argon2 hash pasted by mistake.
Can I use these hashes in Node.js or Python?
Yes. The bcrypt and bcryptjs packages for Node.js and the Python bcrypt package all read $2b$ hashes. For other languages, check that the library supports the $2b$ prefix.
Related Tools
- HMAC Generator - for signing messages with a key, where bcrypt is the wrong tool because it is slow on purpose.
- File Hash Calculator - fast SHA-256 checksums for files, which is not suitable for storing passwords.
- JWT Builder - create a signed test token for the login flow you are building.