1. Home
  2. Developer tools
  3. Bcrypt Generator

Bcrypt Generator

Make a bcrypt hash for a test account or a seed script, or confirm that a password matches a hash from a database.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Bcrypt Generator

  1. Type a password and pick a cost.
  2. Copy the hash, or switch to Verify.
  3. Paste a hash and a password to compare them.

Features

  • Cost 4 to 14 with the time taken shown
  • Verifies $2a$, $2b$ and $2y$ hashes
  • Shows version, cost and salt of any hash
  • Warns about the 72-byte limit
  • Built-in published test vector
  • Computed locally; passwords are never stored

Supported formats

Input

  • Password
  • bcrypt hash

You get

  • bcrypt hash
  • Match result

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Bcrypt Generator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • bcrypt reads only the first 72 bytes of a password.
  • High costs are slow in a browser; a cost of 14 can take several seconds.

Guide

Creating and checking bcrypt password hashes

bcrypt, designed by Niels Provos and David Mazières in 1999, is one of the oldest password hashes still in daily use. It is built on the Blowfish cipher and is deliberately slow, with a cost setting that lets you keep it slow as computers speed up. Frameworks such as Rails, Laravel, Django and Spring offer it by default. This page makes bcrypt hashes for test data and checks whether a password matches an existing hash.

What a bcrypt string contains

A hash looks like $2b$12$ followed by 53 characters. The first part names the version, 2b. The two digits after it are the cost, the base-2 logarithm of the number of rounds, so 12 means 4,096 rounds of the key setup. The next 22 characters are the 128-bit salt and the last 31 are the hash itself. Everything needed to verify a password is in the string, which is why databases store one column.

Creating a hash

Type a password, pick a cost and press the create button. The cost list runs from 4 to 14 with the number of rounds beside each: “10: 1024 rounds”, “12: 4096 rounds (a good default)”, and costs below 10 are marked too low for real use. The page prints the hash and how many milliseconds it took. The Sample button fills the password U*U and cost 10, and the result changes on every press because the salt is random.

Verifying a hash

Switch to “Check a password against a hash”, paste a hash and a password and press Check. The sample for this tab loads the well-known test vector from the Openwall crypt library: the password U*U and the hash $2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW. The page answers “The password matches this hash.” Edit one character and it says the password does not match.

Choosing the cost

OWASP’s guidance is a cost of at least 10, and the usual advice is to choose the highest value that keeps a login under roughly 250 milliseconds to one second on your server hardware. Because the cost doubles the time per step, a cost of 14 takes sixteen times as long as 10. Measure in your own environment, since a browser is slower than a native library.

The 72-byte limit

bcrypt uses the first 72 bytes of its input. Longer passphrases are truncated silently, so two long passwords that agree for 72 bytes produce the same hash. Some systems avoid this by hashing the password with SHA-256 and encoding the digest before bcrypt; this page does not, so a hash made here should match only plain bcrypt. Multi-byte characters count as several bytes.

Limits

Do not enter real passwords: the work is local and nothing is saved, but a password you use should never be typed into a website. bcrypt needs little memory, so GPUs attack it better than they attack memory-hard functions such as Argon2id or scrypt.

Checked against the current version of the Bcrypt Generator on .

Frequently asked questions

How can I compare a password to a hash if every hash is different?

The salt is stored inside the hash string. The checker reads that salt and cost back out, hashes the candidate with them and compares the result. Hashing the same password twice gives two strings that both verify.

Are $2a$, $2b$ and $2y$ hashes interchangeable?

For ordinary passwords they verify identically. The letters mark different fixes for a bug with long or non-ASCII passwords in old implementations. New hashes are normally $2b$, or $2y$ in PHP.

Which bcrypt cost should I use?

Pick the highest cost your login can afford, aiming for roughly a quarter to half a second per hash on your server. OWASP’s guidance is a cost of at least 10. Each step up doubles the time.

Why do two hashes of the same password differ?

bcrypt mixes a random 128-bit salt into every hash and stores it inside the string. Different salts give different hashes, and verification reads the salt back out.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.