Free tool

Bcrypt Hash Generator

The Bcrypt Hash Generator is a simple and secure tool for generating Bcrypt password hashes. It allows you to create strong password hashes to securely store passwords and protect sensitive data.

Cost Factor

Salt
Output
Overview

Free online bcrypt hash generator, checker and analyzer

Turn any password into a secure bcrypt hash, check passwords against hashes, read what a hash contains and find the right cost — all in your browser.

Everything on this page runs locally. Your password is not uploaded, logged or saved, which makes the tool safe for testing logins, debugging authentication and seeding databases. Jump to how it works, choosing the cost or the FAQ.

Runs in Your browser
Versions $2a$ · $2b$ · $2y$
Cost factor 4 – 31
Price Free, no sign-up
How to use

How to use
the bcrypt generator.

Four steps cover everything: make a hash, check a password, read a hash and choose the cost.

  1. manamil.dev/tools/bcrypt-hash-generator
    Generating a $2y$ bcrypt hash with cost 10
    Step 01 / 04

    Generate a hash

    Type or paste the text, pick the cost factor and the prefix, and press Generate Hash. The hash is ready to copy or download in a fraction of a second.

    • →Show / hide the text, and see how many of bcrypt’s 72 bytes you use
    • →“Generate a password” creates a strong random one
    • →$2y$ for PHP and Laravel, $2b$ for Node, Python and Go
    • →“One per line” hashes up to 100 passwords at once
    • →Copy or Download TXT saves the hashes only — there is no share link on purpose, so passwords never end up in a URL
  2. manamil.dev/tools/bcrypt-hash-generator
    Verifying a password against a bcrypt hash: it matches
    Step 02 / 04

    Verify a password

    Enter a password and a stored hash to see if they belong together — the same check as password_verify() or bcrypt.compare() in your login code.

    • →Works with $2a$, $2b$ and $2y$ hashes
    • →“Verify this hash” fills both fields from the generator
    • →Shows the cost and how long the check took
  3. manamil.dev/tools/bcrypt-hash-generator
    A bcrypt hash split into version, cost, salt and checksum
    Step 03 / 04

    Analyze a hash

    Paste any bcrypt hash to see what it is made of and whether something is wrong with it.

    • →Version, cost, 22-character salt and 31-character checksum, in colour
    • →Warns about cut-off hashes, low cost and invalid characters
    • →Tells you how long one check takes on your device
  4. manamil.dev/tools/bcrypt-hash-generator
    Measured bcrypt time per cost factor on this device
    Step 04 / 04

    Pick the cost

    The tool measures your device and shows how long each cost factor takes, so you can choose a safe value that does not slow your logins down.

    • →Aim for about 250 ms per login
    • →Never below cost 10 (OWASP)
    • →Servers are usually a step faster than browsers
What is bcrypt

What is bcrypt,
and why it is safe.

A password-hashing function from 1999 by Niels Provos and David Mazières, based on the Blowfish cipher — the default in PHP, Laravel, Rails and Spring.

Slow on purpose

MD5 or SHA-256 compute billions of hashes per second on a graphics card. Bcrypt is built to be slow, so guessing passwords becomes extremely expensive.

Salted every time

Each hash contains a fresh 128-bit random salt. Two users with the same password get different hashes, and rainbow tables stop working.

A cost you can raise

The cost factor sets 2^cost rounds of work. As computers get faster you raise it by one and every new hash is twice as hard to crack.

One-way only

A bcrypt hash cannot be decrypted. The only way back is to guess and hash again — which is exactly what bcrypt makes slow.

Hash format

The parts of
a bcrypt hash.

Always 60 characters. Salt and cost live inside the hash, so you store just this one string per user.

$2y$10$.Sk4lwq7/SVZ5q7OyiW5iepeubBAr7a0TRF7WT2Bil5VrYIvzGKu6
01

Version

$2y$

Which variant wrote the hash.

02

Cost

10$

2¹⁰ = 1,024 rounds of key setup.

03

Salt

.Sk4lwq7/SVZ5q7OyiW5ie

22 characters, 128 random bits.

04

Checksum

peubBAr7a0TRF7WT2Bil5VrYIvzGKu6

31 characters, 184 bits of hash.

Versions

$2a$, $2b$, $2y$
and $2x$ explained.

$2y$

PHP & Laravel

Written by password_hash() and Laravel’s Hash::make(). PHP’s label since 5.3.7 — the same algorithm as $2b$.

$2b$

Node, Python, Go

The current OpenBSD version (2014), written by most libraries today. Fixes a rare bug with passwords over 255 bytes.

$2a$

Java & older systems

The long-standing common label. Every modern library still reads it.

$2x$

Legacy only

Marks hashes made by an old, buggy PHP implementation. Only for upgrading old data — never create new ones.

Almost every library reads all three modern labels, so a hash made by Laravel ($2y$) can be verified in Node.js or Python, and back.

Cost factor

How to choose
the bcrypt cost.

Every step doubles the work. Pick the highest cost your server can do in about 250 ms per login — and never less than 10, as the OWASP cheat sheet advises.

Cost 8 · Tests onlyToo fast for real passwords 256rounds
Cost 10 · Classic defaultSpring Security, most Node.js apps 1,024rounds
Cost 11 · GoodTwice the work of cost 10 2,048rounds
Cost 12 · RecommendedDefault in PHP 8.4 and Laravel 11+ 4,096rounds
Cost 13 · High securityFast servers, few logins 8,192rounds
Cost 14 · Very slowLogins take a second or more 16,384rounds

The Cost on this device panel in the tool measures your own computer and suggests a value. Raising the cost later is safe: old hashes keep working and can be upgraded at the next login.

Good to know

5 rules for
using bcrypt.

The mistakes that break logins most often — and how to avoid them. Not sure your site is served securely? Run the SSL Server Test.

Comparison

Bcrypt vs Argon2,
scrypt and SHA-256.

How the common choices rank for storing passwords today.

Argon2idMemory-hard; OWASP’s first choice for new systems. Best
scryptMemory-hard; a strong second choice. Great
bcryptSupported everywhere and simple; keep the cost at 10+. Good
PBKDF2For FIPS-140 rules; 600,000+ iterations with SHA-256. OK
SHA-256 / MD5Far too fast for passwords — billions of guesses a second. Never
In your code

Bcrypt in PHP,
Laravel and Node.js.

The tool’s Code examples tab has ready snippets with your cost for 10 languages: PHP, Laravel, Node.js, Python, Django, Java, Go, C#, Ruby and Rust.

PHP
$hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);

password_verify($password, $hash); // true / false
Laravel
use Illuminate\Support\Facades\Hash;

$hash = Hash::make($password);
Hash::check($password, $hash);   // true / false
Node.js
import bcrypt from 'bcrypt';

const hash = await bcrypt.hash(password, 12);
await bcrypt.compare(password, hash); // true / false
FAQ

Questions
people ask.

Yes. The hash is calculated in your browser with JavaScript; the text you type is never sent to our server and is not stored. You can check it yourself: open your browser’s network tab while you press Generate Hash — no request is made. For production passwords, though, the hash should be made by your own server code when the user signs up.