What is Bcrypt Generator?
Bcrypt Generator — A Bcrypt Hash Generator is a free tool that hashes passwords using the bcrypt algorithm and verifies plaintext passwords against existing bcrypt hashes.
Loading your tools...
Generate bcrypt password hashes with adjustable cost factor (salt rounds 4–16) and verify plaintext passwords against existing bcrypt hashes. The industry-standard password hashing algorithm used by Node.js, Python, Ruby, and PHP frameworks. All hashing runs in your browser.
Bcrypt Generator: Enter a password and select a cost factor (10–12 recommended) to generate a bcrypt hash. To verify, paste a password and a bcrypt hash to check if they match. Used for secure password storage.
Higher rounds exponentially increase the time needed to crack the hash but also increases generation time. 10-12 is recommended for modern web apps.
Waiting for input to verify...
Bcrypt verification is safe to perform client-side as the hash contains the salt needed for comparison. No data is sent to the server.
Bcrypt Generator — A Bcrypt Hash Generator is a free tool that hashes passwords using the bcrypt algorithm and verifies plaintext passwords against existing bcrypt hashes.
Enter the password you want to hash in the input field.
Set the cost factor (10–12 recommended for production, 4–6 for fast testing).
Click Generate to create the bcrypt hash — copy it for your database seed or auth config.
Switch to Verify mode to check if a plaintext password matches an existing bcrypt hash.
Generating password hashes for database seed files and user migrations
Verifying bcrypt hashes during login flow development and debugging
Testing cost factor performance to balance security and login speed
Comparing bcrypt output across Node.js, Python, and PHP implementations
Bcrypt (published 1999 by Niels Provos and David Mazières) was the first widely-deployed password hashing function designed around the principle of deliberate slowness. Unlike SHA-256 or MD5 — which are designed to be fast — bcrypt uses a configurable work factor (the "cost") that doubles computation time with each increment. This intentional slowness makes brute-force password cracking impractical even with modern GPUs. Every major framework defaults to bcrypt: Django (since 1.4), Express.js (via bcrypt / bcryptjs), Laravel (Hash::make), Ruby on Rails (has_secure_password), Spring Boot (BCryptPasswordEncoder), Symfony, ASP.NET Core. After 25+ years of cryptanalysis, no practical attack against bcrypt exists.
The bcrypt hash format is a self-contained string with all parameters embedded:
$2b$12$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy
↑ ↑ ↑ ↑
ver cost salt (22 chars) hash (31 chars)| Cost | Rounds | Hash time (modern server CPU) | Recommended use |
|---|---|---|---|
| 4 | 16 | ~1ms | Unit tests only |
| 10 | 1,024 | ~50–100ms | Low-traffic apps, legacy default |
| 12 | 4,096 | ~200–400ms | Production default |
| 14 | 16,384 | ~1.5s | High-security, infrequent login |
| 16 | 65,536 | ~6s | Master keys, root passwords |
Calibration rule: pick the highest cost that keeps the 95th-percentile login time under your latency budget. For consumer apps, target ~300ms per hash (cost 12 on most server CPUs). For internal admin apps, you can afford 1–2 seconds (cost 13–14). Increase cost by 1 every 2–3 years as hardware improves (Moore's law slowdown notwithstanding).
Bcrypt silently truncates passwords longer than 72 bytes (~72 ASCII characters or fewer if the password contains multi-byte UTF-8). This means a 100-character passphrase has the same security as its first 72 characters — and even worse, two passwords identical in the first 72 bytes will hash to the same value. Mitigation: pre-hash the password with SHA-256 before passing to bcrypt: bcrypt(sha256(password)) — this normalizes any password length to 64 bytes (within the limit) and is what Dropbox, Auth0, and several major platforms do. Caveat: only use SHA-256 pre-hashing (not base64) because base64-encoded SHA-256 is 88 bytes — back over the limit.
| Algorithm | CPU-hard? | Memory-hard? | Verdict |
|---|---|---|---|
| bcrypt | Yes | Mildly (4 KB) | Battle-tested default; safe choice |
| argon2id | Yes | Yes (GB-scale) | 2015 PHC winner; modern best choice |
| scrypt | Yes | Yes | Solid, less ubiquitous than bcrypt/argon2 |
| PBKDF2 | Yes | No | FIPS-required; weakest of the four |
Recommendation: use argon2id for new projects if your stack supports it; use bcrypt if you need maximum compatibility or are already in a bcrypt ecosystem. Migrate from PBKDF2 if possible.
On signup: const hash = await bcrypt.hash(password, 12); db.users.insert({email, hash});. On login: const ok = await bcrypt.compare(password, db.users.find(email).hash);. Never store the plaintext password. Never compare hashes with == — bcrypt.compare uses constant-time internally to prevent timing attacks. Implement rate-limiting on login endpoints (e.g., 5 attempts per IP per 10 minutes) to make even high-cost bcrypt brute-forcing impossible online. Add 2FA / WebAuthn / passkeys for high-value accounts.