GALAXY OF TOOLS

SECURITY SECTOR

Bcrypt Generator

Generate bcrypt password hashes with any cost factor and verify a password against an existing hash.

bcrypt uses only the first 72 bytes of a password.
Estimated time in this browser: measuring…
All three use the same algorithm; the prefix only records which implementation produced it.

Hashing and verification run in your browser with the bcryptjs library (loaded from a CDN on first use). Your password and hashes are never sent to a server or stored.

Bcrypt generator and verifier for password hashing

This bcrypt generator hashes a password with the bcrypt algorithm at any cost factor from 4 to 14 and produces a standard 60-character hash such as $2b$10$N9qo8uLOickgx2ZMRZoMye… that drops straight into a users table, an .htpasswd file, a Laravel seeder or a Spring Security test. Switch to “Verify password” to check whether a password matches an existing hash — handy when debugging a login that mysteriously fails.

bcrypt was designed in 1999 by Niels Provos and David Mazières around the Blowfish cipher. Unlike MD5 or SHA-256, it is deliberately slow and has a tunable cost, so brute-forcing a stolen hash is expensive, and each hash carries its own random 128-bit salt, so two users with the same password get different hashes. It remains one of the recommended choices for password storage alongside Argon2id and scrypt.

Hashing happens in your browser using the open-source bcryptjs library; the password never leaves your device.

How to use the Bcrypt Generator

  1. Pick “Generate hash”, type the password and choose a cost factor. 10–12 is the usual range for production; the hint shows the estimated time on your device.
  2. Choose the prefix your platform expects: $2b$ for most modern libraries, $2y$ for PHP’s password_hash(), $2a$ for some older Java and Node libraries.
  3. Press “Generate bcrypt hash”, then copy the 60-character result. Every click produces a different hash because a fresh salt is generated.
  4. To check a password, choose “Verify password”, paste the stored hash, enter the password and press “Verify password”. The breakdown below shows the version, cost, salt and hash portions.

Bcrypt Generator features

Adjustable cost with timing

Costs 4–14 with a measured time estimate for your browser, and a warning when a high cost is likely to stall the page.

Three prefix variants

Produce $2a$, $2b$ or $2y$ hashes to match PHP, Node, Python, Java, Go or Ruby libraries — all verify each other.

Verify against any hash

Compare a password with a hash from your database, including hashes made by other tools; malformed hashes get a clear error.

Colour-coded breakdown

See exactly which characters are the algorithm version, the cost, the 22-character salt and the 31-character hash.

72-byte warning

bcrypt silently ignores anything after 72 bytes; the tool warns you when a password is longer.

Anatomy of a bcrypt hash

A bcrypt hash is always 60 characters and is written as $2b$10$ + 22 characters of salt + 31 characters of hash. Take $2b$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy:

PartExampleMeaning
Version$2b$Algorithm identifier. $2a$, $2b$ and $2y$ are the same maths; $2x$ marks hashes made by a buggy 2011 PHP build.
Cost10Work factor: the key setup runs 210 = 1,024 times. Each +1 doubles the time.
SaltN9qo8uLOickgx2ZMRZoMye16 random bytes (128 bits) encoded in bcrypt’s own Base64 alphabet (./A–Za–z0–9).
HashIjZAgcfl7p92ldGxad68LJZdL17lhWy23 bytes (184 bits) of the Blowfish-encrypted magic string “OrpheanBeholderScryDoubt”.

Choosing the cost factor

The cost is logarithmic: cost 12 does four times the work of cost 10. The right value is the highest one your server can afford per login — usually around 250 ms. In 2026 that typically means cost 11–13 on server hardware; OWASP’s baseline recommendation is a minimum of 10. The estimate shown here is for your browser, which is several times slower than a server-side native implementation.

Because the cost is stored in the hash, you can raise it later: verify the old hash at login, then re-hash the password with the new cost. Costs below 10 are only sensible for unit tests and fixtures.

Using bcrypt correctly

  • Never “decrypt” bcrypt. It is a one-way function; the only way to check a password is to hash the candidate with the same salt and compare, which is what “Verify password” does.
  • Mind the 72-byte limit. Longer passwords are truncated. Some frameworks pre-hash with SHA-256 to allow longer input; do not do this naïvely with raw binary output.
  • Use constant-time comparison (your library’s compare / checkpw / password_verify), never string equality on the hash.
  • Prefix compatibility: PHP writes $2y$, Python’s bcrypt and Go write $2b$, older Java and Node libraries write $2a$. All modern libraries verify all three, so you rarely need to convert.
  • Hashes are for stored passwords. For verifying downloads use the File Hash Checker, and for creating strong passwords the Password Generator.

Bcrypt Generator FAQ

Is it safe to generate a bcrypt hash online?

Here it is, because the hashing runs in your browser with the bcryptjs library and nothing is transmitted. Even so, prefer generating production hashes on the server itself and use this tool for tests, fixtures and debugging.

Can I decrypt a bcrypt hash to get the password back?

No. bcrypt is a one-way hash with a random salt. The only way to recover a password is to guess it and verify each guess, which the cost factor makes slow by design.

Why is the hash different every time I generate it?

Each hash includes a fresh random 128-bit salt, so the same password produces a different hash on every run. All of them verify correctly against the password.

Which cost factor should I use?

Use the highest cost that keeps login under about a quarter of a second on your server — commonly 11 to 13 today, and never below 10 for real accounts.

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

They all describe the same algorithm. $2y$ was introduced by PHP in 2011 to distinguish correctly generated hashes from a buggy build ($2x$); $2b$ was added by OpenBSD in 2014 after fixing a length-wrapping bug. Modern libraries verify all three.

Is bcrypt still recommended in 2026?

Yes. OWASP lists Argon2id first, then scrypt and bcrypt, and bcrypt remains a solid choice with a cost of 10 or more, especially where Argon2 is unavailable.

You might also need