bcrypt Playground

Hash passwords with bcrypt at cost 4–16, use your own 22-character salt, see the hash broken into version, cost, salt and hash, and verify hashes.

0 of 72 bytes used

2^cost = 1,024 rounds

Leave empty to use a random salt.

bcrypt (Provos & Mazières, 1999) is an adaptive hash: each +1 in cost doubles the work. Pick the highest cost that keeps login under about 250 ms on your server (10 or more). Output uses the $2b$ prefix; $2a$ and $2y$ hashes verify the same way.

Verify a password against a hash

Runs entirely in your browser. Your data is never uploaded.

What is bcrypt Playground?

Experiment with bcrypt: choose the cost factor, enter a specific salt or use a random one, and see the resulting hash split into version, cost, salt and hash, along with how long it took. The verifier checks passwords against $2a$, $2b$ and $2y$ hashes.

How to use bcrypt Playground

  1. Enter the Password; the hint shows how many of bcrypt's 72 bytes are used.
  2. Set the Cost factor (4–16) and optionally a 22-character Salt.
  3. Click Hash to see the encoded hash, its parts and the time taken.
  4. Paste any bcrypt hash into the verify panel to test a password.

Example

Input
Password password, cost 4, salt abcdefghijklmnopqrstuu
Output
$2b$04$abcdefghijklmnopqrstuughE8Ev8uGFaUgY2cNEySvxngrb/Jzdm

Matches the output of pyca/bcrypt for the same password and salt.

When to use bcrypt Playground

Use it to reproduce a bcrypt hash with a known salt, pick a cost factor by measuring timings, or verify a hash from a database during debugging. Prefer Argon2id for new designs.

How bcrypt Playground works

bcrypt (Provos & Mazières, 1999) runs the expensive EksBlowfish key setup 2^cost times, then encrypts 'OrpheanBeholderScryDoubt' 64 times. The 16-byte salt and the 23-byte result are written in bcrypt's own Base64 alphabet (./A–Za–z0–9). Computation uses hash-wasm (WebAssembly). Passwords longer than 72 UTF-8 bytes are rejected because bcrypt ignores everything after byte 72.

Common Use Cases

  • Measuring how long each cost factor takes
  • Reproducing a test vector with a fixed salt
  • Checking that a $2y$ PHP hash verifies
  • Teaching the structure of bcrypt hashes

FAQs

What cost factor should I use?

At least 10 (OWASP); choose the highest value that keeps hashing under about 250 ms on your server. Each +1 doubles the time.

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

They mark fixes for old implementation bugs. For passwords up to 72 bytes they produce the same hash, and all three verify here.

Why is my long password rejected?

bcrypt only uses the first 72 bytes. Silently truncating would make different passwords collide, so the tool refuses instead.

Explore more categories