File & privacy

Bcrypt Generator

Bcrypt Hash Generator and Checker

Hash a password with bcrypt at any cost, or check a password against a bcrypt hash.

About this tool

About Bcrypt Generator

Bcrypt is the password-hashing function behind many web frameworks, including Laravel, Spring Security and Devise. This tool creates a bcrypt hash of any password with a cost from 4 to 15, so you can seed a test database, reset an admin user by hand or check what a framework stores. A second panel verifies a password against an existing $2a$, $2b$ or $2y$ hash, shows its version, cost and salt, and explains exactly what is wrong if the hash is malformed. Hashing runs in a background worker with a progress bar, so even cost 15 never freezes the page, and the time taken on your device helps you choose a cost: aim for a quarter to half a second on your server. The tool warns when a password is longer than bcrypt's 72-byte limit. It uses the open-source bcryptjs library, generates the salt with Web Crypto and compares in constant time. Passwords and hashes never leave your browser.

Built and maintained by Abhi JainUpdated

How to Generate and Verify a Bcrypt Hash

  1. 1

    Enter a password

    Type the text under Hash a password and choose the Cost (work factor). 12 is a common choice.

  2. 2

    Generate the hash

    Click Generate hash and copy the 60-character result starting with $2b$.

  3. 3

    Verify a password

    Under Verify a password, enter a password and a bcrypt hash, then click Check password to see Match or No match.

Bcrypt Generator: questions and answers

Can a bcrypt hash be decrypted?

No. Bcrypt is a one-way hash, not encryption. The only way to find the password is to guess it and compare, which bcrypt deliberately makes slow. That is why this tool verifies passwords rather than decrypting hashes.

What cost factor should I use?

OWASP recommends at least 10. Pick the highest cost your server can afford, typically one where a hash takes around 250 ms. Each step up doubles the time, both for you and for an attacker.

Why do I get a different hash every time?

Each hash includes a random 128-bit salt (the 22 characters after the cost). The same password with a different salt gives a different hash, and both verify correctly.

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

They are versions of the same algorithm. $2b$ is current; $2y$ is PHP's name for the corrected version; $2a$ is older. For normal ASCII and UTF-8 passwords they produce compatible results, and this tool verifies all three.

Is there a password length limit?

Yes. Bcrypt uses only the first 72 bytes of the password (fewer characters for non-Latin text, since UTF-8 uses several bytes each). Anything after that is ignored. The tool shows the byte count and warns you.

Is it safe to type a real password here?

Hashing happens entirely in your browser and nothing is transmitted, but as a habit, avoid typing live production passwords into any web page. Generate test hashes with test passwords.