bcrypt Online - Password Hashing

Generate and verify bcrypt password hashes online in your browser. This bcrypt generator creates salted $2b$ hashes with a configurable cost factor, and the verifier checks a password against existing $2a$, $2b$, or $2y$ hashes without uploading data.

Password
0 chars · 0 bytes
Hash to verify against
Try:
Result
✓ Client-side processing only ✓ Input is not sent to server
Examples
Common password
Cost factor (4–31): 12
Input password123

A typical password. Click Compute to generate a salted bcrypt hash with the default cost factor.

Passphrase
Cost factor (4–31): 12
Input correct horse battery staple

A longer passphrase example. bcrypt uses only the first 72 bytes, so very long Unicode passwords need careful handling.

Fast compatibility cost
Cost factor (4–31): 10
Input legacy-login-demo

Generates a bcrypt hash with cost 10, useful for comparing a lower compatibility work factor with the default.

Higher-cost admin password
Cost factor (4–31): 14
Input admin-vault-passphrase-2026

Uses a higher bcrypt cost to demonstrate the security/performance trade-off. Expect noticeably slower generation and verification.

What is bcrypt?

bcrypt is a password hashing function designed by Niels Provos and David Mazières and published at USENIX in 1999. It is based on the Blowfish cipher and was built for password storage, not general file checksums: each password guess is intentionally slow, uses a unique salt, and can be made more expensive by raising the cost factor.

A bcrypt password hash is a self-contained string such as $2b$12$.... It stores the algorithm version, the cost, a 128-bit salt encoded in bcrypt's custom Base64 alphabet, and the final hash. Because the salt and cost are embedded, a database normally stores one bcrypt string per user password and the verification library can reproduce the same settings later.

Use this bcrypt online tool when you need a bcrypt hash generator for documentation, test fixtures, migration checks, or quick experiments with cost factors. Use the Verify mode when you have an existing bcrypt hash and want to check whether a candidate password matches it.

Cost factor explained

bcrypt's cost factor is an exponent: cost 10 means roughly 2^10 units of internal work, cost 12 means roughly 2^12, and each increase by 1 doubles the work needed for both attackers and legitimate logins. A conservative bcrypt baseline is a work factor of 10 or more when Argon2id or scrypt are not available, and the practical value should be benchmarked on the server that will handle real authentication.

This tool exposes cost values from 4 to 31, with 12 as the default. Lower values are useful only for demonstrations and fast tests; production systems should choose the highest cost that still keeps login verification responsive under load. As a rule of thumb, aim for a noticeable but acceptable delay, monitor sign-in latency, and raise the cost over time as hardware improves.

The cost is stored inside each bcrypt hash, so old hashes can still be verified after you change the policy. A common upgrade pattern is to verify the old hash during login, then rehash the same password with the newer cost and replace the stored value after successful authentication.

How this bcrypt generator and verifier works

In Generate mode, enter a password or passphrase, choose the cost factor, and run the calculation. The browser creates a random salt automatically and returns a bcrypt string beginning with $2b$. Running the same password twice should produce different hashes because the salt is different every time.

In Verify mode, paste the candidate password as input and paste the stored bcrypt hash into the verification field. The tool reads the cost and salt from the stored hash, runs bcrypt with the same parameters, and returns whether the password matches. It recognizes modern bcrypt strings beginning with $2a$, $2b$, or $2y$.

Everything runs client-side with the JavaScript bcrypt implementation used by the page. The password and hash are not sent to the server, which makes the tool convenient for examples and debugging. For real user accounts, still hash and verify passwords inside your application backend using a maintained server-side library, rate limiting, audit logging, and secure deployment practices.

Common bcrypt use cases

Developers usually need bcrypt for a few practical tasks: creating a bcrypt password hash for a test user, verifying whether a password matches a stored hash, comparing bcrypt cost factors, checking the meaning of a $2b$ hash string, or planning a migration from legacy password storage.

This page covers common bcrypt generator and verifier questions: how to generate a bcrypt hash online, how to verify a bcrypt hash, what a bcrypt salt is, how the cost factor works, how bcrypt compares with Argon2, and why the 72-byte password limit matters. The important production pattern is simple: generate a unique salted hash, store the full bcrypt string, verify with a maintained library function, and rehash when the stored cost becomes weaker than your current policy.

FAQ

bcrypt internally truncates input passwords to 72 bytes. Longer passwords have their tail silently ignored — anything beyond byte 72 contributes nothing to security. A common workaround is to first hash the password with SHA-256 (giving 32 bytes) and feed the hash into bcrypt; alternatively, switch to Argon2id which has no such limit.

For new systems, Argon2id is generally preferred because it is memory-hard, which makes GPU-based attacks more expensive than against bcrypt. Choose bcrypt when you need broad library support, very stable behaviour, or compatibility with platforms that already store bcrypt hashes. bcrypt remains acceptable when configured with a strong cost factor.

These are versions of the bcrypt encoded format. $2a$ is the original; $2y$ was introduced in PHP to mark fixed implementations after a 2011 sign-extension bug; $2b$ is the current standard format used by modern OpenBSD-style bcrypt libraries. New hashes generated here use $2b$, while verification of older $2a$ and $2y$ hashes works in modern libraries.

No. bcrypt runs entirely in your browser using the bcryptjs library — your password never leaves your device. No network requests, no logging, no server-side processing. Still: do not use this tool for production password hashing of real user accounts — use a server-side library with secure randomness, rate limiting, and monitoring.

No. bcrypt is a one-way password hashing function, not encryption. You cannot recover the original password from the hash. Verification works by hashing a candidate password with the cost and salt embedded in the stored bcrypt string, then comparing the result.

bcrypt uses a unique random salt for each generated hash. The salt is stored inside the output string, so verification still works, but two users with the same password should not have identical stored hashes. This prevents simple lookup tables and makes bulk cracking more expensive.

Use at least 10 for bcrypt, and benchmark on your real authentication server. Cost 12 is a common starting point for modern applications, but the right value is the highest cost that your login flow, background jobs, and abuse controls can handle without unacceptable delay.

Usually no. A standard bcrypt string already contains the version, cost, salt, and hash. Store the full value exactly as generated, for example a string beginning with $2b$12$..., and let your bcrypt library parse it during verification.

Yes. The verifier accepts the common bcrypt prefixes $2a$, $2b$, and $2y$. New hashes generated by this tool use the modern $2b$ format.

bcrypt is still acceptable when configured with a strong cost factor, but Argon2id is the preferred choice for new password storage where available because it is memory-hard. Choose bcrypt when you need broad compatibility, platform support, or migration consistency with an existing bcrypt password database.
Related tools

HMAC Generator

Generate an HMAC from text with a secret key in your browser.