TodayTools

Bcrypt hash generator and checker

Store sign-in passwords the safe way and check a login against the saved hash.

PrivateNo uploadsRuns in your browser

Donate
Mode
CostNode.js default
1,024 rounds

Cost sets how slow each guess is for an attacker. Higher is safer but slower; 10 to 12 suits most sites. New salt gives a fresh hash for the same password.

Use it in your code

Language
# pip install bcrypt
import bcrypt

# Hash: a new salt every time, cost 10
hashed = bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=10)).decode()

# Verify: True when the password fits the hash
is_verified = bcrypt.checkpw(password.encode(), hashed.encode())

Uses the cost chosen above. Store the whole 60-character hash in one column; the check reads the version, cost and salt back out of it.

Three women chatting with a tablet

For the new app

Keep every password safe.

First users. Siddharth's app gets its first sign-ups.

BeforePasswords kept as plain text

With sdevStrong, locked passwords

  • A woman testing an app on her laptop

    Locked tight

    Every password is stored the safe way.

  • A smiling woman with her team in an office

    Launch night

    The team launches with confidence.

How to generate and verify a bcrypt hash

  1. Type or generate a password

    Type the password you want to store, or press Generate for a random password, passphrase or PIN. The hash appears a moment later, already checked against the password.

  2. Choose the cost

    Slide the cost to match your app. Higher is slower and safer; 10 or 12 suits most sign-in pages.

  3. Copy, download or verify

    Copy the hash, or download it as text, JSON, CSV, .env, SQL or a MongoDB update. Switch to Verify to check a password against a hash you already have.

Good to know

  • Store the whole hash string. The version, cost and salt are part of it, so your app needs no extra column to check a password later.
  • Generate makes the password with your browser's cryptographic random source, with the same options as the password generator. Change an option and a new one is made; type in the box and your own text is kept.
  • Verify works with hashes from Python, Node.js, PHP and Java. Paste the hash from your database, type the password, and the result shows at once.
  • Use bcrypt, not MD5 or SHA-256, for passwords. Fast hashes are made for checksums and can be guessed billions of times a second.
  • Untick Include password before you download if the file is going anywhere shared. The SQL and MongoDB exports never contain the password.
  • Cost 15 takes a few seconds in a browser. The page shows progress, and you can keep typing while it works.

Where people use it

  • Set a first admin password

    Make a bcrypt hash to put straight into your database for a new admin user.

  • Check a password against a hash

    Find out if a password matches a $2a, $2b or $2y hash.

  • Pick the right cost

    Try different cost values and see how long each one takes.

  • Need a strong password first?

    Make a random password or passphrase, then hash it here.

    Strong password generator
  • Need SHA-256 or MD5?

    For a file checksum or another hash, use the hash generator.

    Hash generator

Why this one

Bcrypt cannot be undone, so the page checks a password against a hash instead, and it all runs on your device.

  • Hash and check on one page.
  • Works with $2a, $2b and $2y hashes.
  • Passwords never leave your browser.

What you can change

  • Cost
  • Hash or verify
  • Make a password, passphrase or PIN first

People find this page by searching

  • bcrypt generator
  • bcrypt hash generator
  • bcrypt online
  • bcrypt verify
  • check bcrypt hash
  • bcrypt password hash
  • bcrypt decrypt
  • bcrypt cost factor
Cite this tool
  • APA
    sdev.in. (n.d.). Bcrypt generator and checker [Web tool]. https://www.sdev.in/tools/bcrypt-generator
  • MLA
    "Bcrypt generator and checker." sdev.in, https://www.sdev.in/tools/bcrypt-generator.
  • Chicago
    sdev.in. "Bcrypt generator and checker." https://www.sdev.in/tools/bcrypt-generator.
  • BibTeX
    @misc{sdev-bcrypt-generator,
      title = {Bcrypt generator and checker},
      author = {{sdev.in}},
      howpublished = {\url{https://www.sdev.in/tools/bcrypt-generator}},
      note = {Web tool}
    }

Questions people ask

Why is the hash different every time?

Each hash gets a new random salt, which is stored inside the hash itself. Two hashes of the same password look different, yet both verify, so a stolen database cannot be matched against a table of common passwords.

Which cost should I pick?

Pick the highest cost your server can check in about a quarter of a second. 10 is the common default in Node.js and 12 is the default in Python's bcrypt and Flask-Bcrypt. Each step up doubles the time for you and for anyone guessing.

Will a hash from here work in my app?

Yes. The output is a standard $2b$ hash that Python bcrypt, Flask-Bcrypt, Node bcrypt and bcryptjs, PHP password_verify, Spring Security and Go all accept. Verify also reads $2a$ and PHP's $2y$ hashes.

Why does bcrypt ignore part of my password?

Bcrypt only uses the first 72 bytes of the password. Letters outside English take two to four bytes each, so the limit can arrive sooner than you expect. The page warns when a password goes past it.

Is my password sent anywhere?

No. Generating, hashing and checking all run in your browser, the hashing in a web worker. The password and the hash stay on your device.

Donate