Skip to content
OnlineToolStudio

Bcrypt Generator & Checker

runs in your browserno sign-upfree

Create bcrypt password hashes and check a password against a hash. Choose the cost, see each part of the hash, and get PHP, Node and Python code.

Generate a hash

0 / 72 bytes
Each click uses a new random salt

Check a password against a hash

Use it in your code

About this tool

Bcrypt is the standard way to store passwords: it is slow on purpose and adds a random salt, so stolen hashes are very hard to crack. Use this tool to create a bcrypt hash of a password — for a database seed, a config file or a test user — or to check whether a password matches a hash you already have. Hashes work with PHP password_hash() and password_verify(), Laravel, WordPress, Node.js and Python.

How to use

  1. Choose the cost (12 is a good default) and the prefix — $2y$ for PHP, $2b$ for most other languages.
  2. To create a hash, type a password and press Generate hash, then copy the 60-character result.
  3. To check a password, type it on the right, paste the hash, and press Check password.
  4. Copy the PHP, Node.js or Python code below to do the same in your app.

FAQ

Can a bcrypt hash be decrypted?

No. Bcrypt is a one-way hash, not encryption, so there is nothing to decrypt. The only way to find the password is to guess it — and bcrypt is slow on purpose so that guessing takes a very long time. To test a password, use Check password.

Why do I get a different hash every time?

Each hash gets a new random salt, which is stored inside the hash itself (the 22 characters after the cost). Different hashes of the same password are all correct — the check reads the salt from the hash you give it.

Which cost should I use?

Use 12 for new projects, and never less than 10. Each step doubles the time: pick the highest cost your server can handle while keeping login under about a quarter of a second. PHP 8.4 and Laravel use 12 by default; older PHP versions use 10. The cost list shows an estimate for this device once you have made a hash.

What is the difference between $2y$, $2b$ and $2a$?

They are the same algorithm. $2y$ is the name PHP uses, $2b$ is used by most other libraries, and $2a$ is the original version. A correct library accepts all three, so any of them works with PHP password_verify, bcryptjs and Python bcrypt.

Why is there a 72-byte limit?

Bcrypt only uses the first 72 bytes of a password and silently ignores the rest. Letters such as é or emoji take 2–4 bytes each, so the counter shows bytes, not characters. Very long passwords should be pre-hashed (for example with SHA-256) before bcrypt — or use Argon2.

Is my password sent anywhere?

No. Hashing and checking run entirely in your browser, and nothing you type is saved. Even so, avoid typing a live production password into any website.

Bcrypt or MD5 / SHA-256 for passwords?

Always bcrypt (or Argon2). MD5 and SHA-256 are designed to be fast, so a graphics card can try billions of guesses per second. Use the Hash Generator for checksums and fingerprints, not passwords.

Related tools

All tools