Cipher Utility

Bcrypt Generator

H-05

Hash a password with bcrypt, or check one against a hash. Runs in your browser; nothing is sent anywhere.

Parts of the hash

VersionCostSalt, 22 charactersHash, 31 characters

How to check a password

  1. Type the password on the left.
  2. Paste the stored hash into Check against.
  3. Green means the password is right.
  4. The cost and salt are read from the hash.

Reading a hash

$2y$10$Frm80075DltOzu3skhaCPu89N2juChd8uaOvfu18bLAT3.cf1KkmK

$2y$ version, cost 10,

then 22 characters of salt and 31 of hash.

Password: hello

Further reading

Cipher Utility reference card Catalog no. H-05

What bcrypt is

Bcrypt is a password hashing function designed by Niels Provos and David Mazières and published in 1999. Unlike MD5 or SHA-256, it is meant to be slow. A cost setting decides how much work each hash takes, and every step up doubles it. That barely matters when one user logs in, but it makes trying millions of guesses very expensive.

Bcrypt also adds a random salt to every password. Two users with the same password get different hashes, so an attacker cannot use precomputed tables or crack many accounts at once.

The hash format

A bcrypt hash is 60 characters long and carries everything needed to check a password:

$2y$10$Frm80075DltOzu3skhaCPu89N2juChd8uaOvfu18bLAT3.cf1KkmK version $2y$ cost 10, so 2^10 = 1,024 rounds salt Frm80075DltOzu3skhaCPu hash 89N2juChd8uaOvfu18bLAT3.cf1KkmK

The versions $2a$, $2b$ and $2y$ differ only in how old implementations handled rare edge cases. Modern libraries accept all three.

Choosing a cost

CostRoundsWork compared with cost 10
82561/4
101,0241×
124,0964×
1416,38416×

Use the highest cost your login server can handle comfortably, and raise it every few years as hardware gets faster. Our article on hashing passwords correctly covers the alternatives, such as Argon2 and scrypt.

Questions about bcrypt

Why does the same password give a different bcrypt hash every time?

Bcrypt adds a random 128-bit salt before hashing and stores that salt inside the hash. Two hashes of the same password therefore look different, yet both verify, because the checker reads the salt back out of the hash.

What cost should I use?

Pick the highest cost your server can afford for each login. Many frameworks default to 10 or 12. Each step up doubles the work, so cost 12 takes four times as long as cost 10. The timing next to the hash shows how long it took in your browser.

Are these hashes compatible with PHP, Node.js and other languages?

Yes. This page uses bcryptjs, a standard bcrypt implementation. We checked that its hashes verify with PHP's password_verify and that PHP hashes verify here. The $2y$ prefix used by PHP and the $2a$ and $2b$ prefixes are treated the same.

Can a bcrypt hash be decrypted?

No. Like any hash it is one-way. The only attack is guessing passwords and hashing each guess, and bcrypt is designed to make every guess slow.

Is there a length limit?

Bcrypt uses only the first 72 bytes of a password and ignores the rest. The tool warns you when a password is longer.

Is my password sent to a server?

No. Hashing and checking run in your browser with JavaScript, and the password never leaves your device.