Dev TooloraLocal dev tools

> Crypto

Bcrypt Hash & Verify

Hash a password with bcrypt ($2b$, cost 4-14) or verify a password against a $2a$, $2b$ or $2y$ hash, entirely in your browser.

Runs locallyWorks offline
Back to results
Input

Source data

Mode
Output

Result

Your result will appear here.

Tool guide

About this tool.

  • Bcrypt is a password hashing function built on the Blowfish cipher. It mixes a random 128-bit salt and a cost factor into the hash, so the same password gives a different hash every time and every guess costs the attacker real CPU time.
  • A bcrypt hash is one string such as $2b$10$ followed by 22 salt characters and 31 hash characters. It carries the version, the cost and the salt, so verifying needs only the password and that string.
  • The tool runs locally with bcryptjs. The password is never uploaded or saved in drafts.

  • Create a hash to seed a test database or a fixture.
  • Check whether a password matches a hash taken from a user table or a config file.
  • Compare how long different cost values take before choosing one for your application.

Choose Hash or Verify.

Enter the password. In Hash mode pick a cost between 4 and 14; in Verify mode paste the bcrypt hash.

Press Run. A hash can take a moment at a high cost.

Copy or save the hash, or read Match or No match.

  • Hash "correct horse battery staple" at cost 10 → a 60-character $2b$10$ hash and "Cost 10 · 2^10 rounds · took 81 ms".
  • Hash the same password twice → two different hashes, because each run uses a new salt.
  • Verify "U*U" against $2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW → Match.
  • Verify "U*V" against the same hash → No match.
  • Verify " a" against a hash of "a" → No match, because spaces are part of the password.
  • Hash a 37-character password of "é" → an error that it is 74 bytes, above the 72-byte limit.

  • Hash output always starts with $2b$. Verify accepts $2a$, $2b$ and $2y$ hashes; other prefixes such as $2x$ are errors.
  • The cost is an integer from 4 to 14. A hash with a cost outside that range is rejected before any work, so a hostile hash cannot block the worker.
  • The password is used exactly as typed: spaces are kept and nothing is trimmed or normalized.
  • Only the first 72 UTF-8 bytes count in bcrypt, so longer passwords are rejected instead of silently cut. A character such as é takes 2 bytes.
  • An empty password gives "Password is empty."
  • The tool does not run automatically because the output is random and a high cost takes time. Press Run.
  • A malformed hash gives the expected shape: $2b$10$ followed by 53 characters of [./A-Za-z0-9].

FAQ

Questions about Bcrypt Hash & Verify

Which cost should I use?

Each hash costs 2^cost rounds, so every step doubles the time. A cost of 10 takes roughly 80 ms on a laptop and 12 about 300 ms. Pick the highest value your login path can afford, and not below 10.

Why is there a 72-byte limit?

Bcrypt reads at most 72 bytes of the password and ignores the rest, so two long passwords with the same first 72 bytes would match. The tool refuses longer passwords; pre-hash them first if you need them.

Why does the hash change every time?

Every hash gets a fresh random salt, so the output changes on each run. That is why the tool does not run automatically; use Verify to check a password against a hash.

Why is the tool slow at a high cost?

A high cost blocks the shared worker while it runs, so the next run in the same editor waits until the hash finishes. Cost 14 can take more than a second.

Is my password stored or sent anywhere?

No. The password is hashed in your browser and discarded. It is a password field, so it is excluded from saved drafts.

Continue with

PBKDF2 Key DerivationDerive a key from a password with PBKDF2 (HMAC-SHA-1/256/384/512): choose the salt, iterations and length, and get findings for weak settings.Password StrengthInspect a masked password with an honest local checklist; no breach check, crack-time estimate or strength certification.Hash GeneratorHash exact UTF-8 text or local file bytes with SHA-256, SHA-512, SHA-1 or MD5.Argon2 Hash & VerifyHash a password with Argon2id, Argon2i or Argon2d into a PHC string, or verify a password against one, entirely in your browser.