Bcrypt Hash Generator & Checker

Generate a bcrypt hash with the cost factor you choose, or check whether a password matches a bcrypt hash. Free, and it all runs in your browser.

Nothing you type leaves this page. Hashing and checking run locally in your browser. No network requests are made with your password or hash, nothing is logged or stored, and it is gone when you close or reload the tab.

Bcrypt reads at most the first 72 bytes of a password.

Cost 10 = 2^10 = 1,024 iterations. Each +1 doubles the time.

How to use the bcrypt generator and checker

  1. To create a hash, choose Generate hash, type the password and pick a cost factor. Cost 10–12 is typical for web apps.
  2. Click Generate bcrypt hash and copy the result into your database, config file or test fixture.
  3. To verify, choose Check password against hash, enter the password and paste the stored hash, then click Check password.
  4. Not sure the password is strong enough to hash? Test it with the Password Strength Checker, or create a random one with the Password Generator.

What a bcrypt hash looks like

$2b$10$Cl7BQNy9v5ht09mAZ5PL6.XAWA4w.PUQapeQwkiqOuj3GRcFFApky
 │ │  │                      └─ 31 characters: the hash itself
 │ │  └─ 22 characters: the random salt
 │ └─ cost factor (10 = 2^10 = 1,024 rounds)
 └─ algorithm version ($2b$)

Worked example

Hashing correct horse battery staple at cost 10 gives the 60-character string above. The salt is stored inside it, so hashing the same password again produces a completely different string, yet the checker still returns a match for both. A near-miss such as Correct horse battery staple (capital C) returns no match. Use Load example to try it.

Cost matters because every +1 doubles the work. If one hash takes about 60 ms at cost 10, cost 12 takes about 240 ms and cost 14 about 1 second. That delay is invisible to a user logging in once but multiplies by billions for an attacker trying guesses.

Bcrypt is one-way hashing, not encryption

Encryption is reversible with a key. A hash is not: bcrypt turns a password into a fixed-size string with no way back, so there is no "bcrypt decrypt". Sites store the hash rather than the password, and at login they hash what you typed with the stored salt and cost and compare the results. A leaked database then exposes only slow-to-crack hashes, not passwords. The only way to "reverse" a bcrypt hash is to guess passwords and hash each one, which is why a strong, long, unique password and a sensible cost factor both matter.

This tool uses the open-source bcryptjs library, a pure JavaScript bcrypt implementation. It is slower than native bcrypt on a server, so timings shown here are an upper bound. Never paste a real production password into any website you do not control.

Frequently Asked Questions (FAQ)

Is it safe to type a password into this bcrypt generator?

The hashing runs entirely in your browser with JavaScript. The page makes no network request with what you type, writes nothing to storage or logs, and the input is excluded from analytics. You can confirm in your browser’s Network tab. Still, avoid pasting a live production password into any website; test with a sample password of the same style.

Can a bcrypt hash be decrypted?

No. Bcrypt is a one-way hash function, not encryption, so there is no key and no way to reverse a hash back to the password. Checking a password means hashing the guess with the same salt and cost and comparing the result, which is what the Check tab does.

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

Bcrypt generates a fresh random 128-bit salt for every hash and stores it inside the hash string. Two hashes of the same password differ, yet both verify correctly because the checker reads the salt back out of the hash.

What cost factor (rounds) should I use?

The cost factor is a power of two: cost 10 means 2^10 = 1,024 iterations of the key schedule, and every +1 doubles the work. Pick the highest cost your server can afford while keeping a login under roughly 250–500 ms; cost 10–12 is a common range today. This page runs in JavaScript, which is slower than native bcrypt, so the same cost takes longer here than on your server.

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

They are bcrypt version prefixes. $2b$ is the current standard and is what this tool generates. $2a$ and $2y$ hashes from older libraries (including PHP’s $2y$) use the same algorithm for ordinary passwords and verify here too.

Is there a password length limit?

Yes. Bcrypt only uses the first 72 bytes of the password, so anything beyond that is ignored. Non-ASCII characters take more than one byte each. This tool warns you when your password exceeds 72 bytes. If you need long passphrases, hash them with SHA-256 first or use a different algorithm such as Argon2.

Is bcrypt still good for passwords?

Yes. It is deliberately slow and salted, which makes brute-force attacks expensive, and it has a long track record. Argon2id is a newer, memory-hard alternative that OWASP lists first, with bcrypt as an acceptable choice for existing systems.