Unique Random Salt
Bcrypt generates a random salt for each new hash. This means that hashing the same password multiple times normally produces different hash strings.
Generate secure bcrypt password hashes, check whether a password matches an existing bcrypt hash, and inspect hash information. Choose a cost factor and create a new salted bcrypt hash directly in your browser.
Create a new bcrypt hash or check an existing password hash. The password fields are processed in your browser and are not submitted through a form to Permitir.net.
Enter a password, select a cost factor and generate a new bcrypt hash with a randomly generated salt.
Check whether a password matches an existing bcrypt hash. Verification uses the salt and cost information embedded in the supplied hash.
Inspect the structure of a bcrypt hash. Identify its version, cost factor, salt section and hash digest.
Bcrypt is a password-hashing algorithm designed to make password guessing more computationally expensive.
Bcrypt generates a random salt for each new hash. This means that hashing the same password multiple times normally produces different hash strings.
The cost factor controls how much computational work bcrypt performs. Increasing the cost makes hashing and verification slower.
Bcrypt is not encryption. A bcrypt hash is designed for password verification, not for recovering the original plaintext password.
A bcrypt generator is a tool that converts a password into a one-way password hash using the bcrypt algorithm. Developers use bcrypt to create password hashes for authentication systems, test login implementations and understand how password hashing works.
Unlike ordinary data encryption, password hashing is not designed to be reversed. An application stores the resulting hash instead of storing the original password. When a user attempts to log in, the application checks the submitted password against the stored hash.
The bcrypt cost factor determines the computational effort used during password hashing. It is an exponent: each increase of one cost level approximately doubles the computational work.
For example, cost 10 represents a work factor of 210, while cost 12 represents 212. A higher cost makes password hashing more expensive for both legitimate applications and attackers attempting large numbers of guesses.
The appropriate setting depends on the hardware and performance requirements of the application. Test the selected cost on the actual server that will verify passwords. A browser-based generator can take longer than a native server implementation.
A standard bcrypt hash is 60 characters long. It contains the algorithm version, cost factor, salt and resulting password digest.
$2a$12$abcdefghijklmnopqrstuuXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The example above illustrates the general structure. The actual salt and digest are generated by the bcrypt algorithm and are not fixed values.
Bcrypt uses a randomly generated salt. Consequently, generating a hash for the same password more than once normally produces different results.
This is expected behavior. When checking a password, use a bcrypt verification function rather than generating another hash and comparing the two strings. The verification function reads the salt and cost information from the existing hash.
Bcrypt implementations commonly support a maximum password input length of 72 bytes. This is a byte limit rather than a character limit.
UTF-8 characters can occupy different numbers of bytes. Therefore, a password containing accented characters or emoji may reach the 72-byte limit before it reaches 72 visible characters.
This tool checks the UTF-8 byte length before generating a hash and rejects inputs that exceed the supported limit. This avoids silently hashing only part of a longer password.
SHA-256 is a general-purpose cryptographic hash function. It is designed to be fast. That makes it useful for integrity checks and other cryptographic applications, but it is not an appropriate standalone password-storage algorithm.
Bcrypt is specifically designed for password hashing. Its configurable work factor makes each password verification more computationally expensive.
For new systems, consider Argon2id where available. Bcrypt remains useful for compatibility with existing applications and systems that already use bcrypt hashes.
PHP provides native password-hashing functions. The following example creates a bcrypt hash using PHP's password_hash() function:
$password = 'example-password';
$hash = password_hash(
$password,
PASSWORD_BCRYPT,
['cost' => 12]
);
echo $hash;
To verify a password against a stored bcrypt hash, use password_verify():
$password = 'example-password';
$storedHash = '$2y$12$...';
if (password_verify($password, $storedHash)) {
echo 'Password is valid';
} else {
echo 'Invalid password';
}
PHP automatically generates a salt when using password_hash() without a manually supplied salt. The resulting hash contains the information needed for password verification.
This tool uses browser-based bcrypt processing. The password and hash are handled by JavaScript in the visitor's browser; the tool does not submit them to a PHP form or store them in a Permitir.net database.
The page loads the bcrypt.js library from a public content delivery network. As with any website that loads third-party JavaScript, users should not enter real production credentials or sensitive passwords into an online tool. For production password handling, use a trusted implementation in your own application or development environment.
Answers to common questions about bcrypt hashes, password verification and cost factors.
A bcrypt hash is a one-way password hash generated using the bcrypt password-hashing algorithm. It includes a salt and cost information used when verifying a password.
No. Bcrypt is a one-way password-hashing algorithm, not an encryption algorithm. You cannot use it to decrypt a hash and retrieve the original password. Passwords are checked by verifying a candidate password against the stored hash.
Bcrypt automatically generates a new random salt when a hash is created. This is normal and desirable. The same password can therefore produce different bcrypt hash strings.
This tool uses cost 12 as its default. OWASP recommends a minimum work factor of 10 for bcrypt. The best value depends on the performance of the system that will generate and verify hashes.
Most bcrypt implementations support up to 72 bytes. This is not necessarily 72 characters because multi-byte UTF-8 characters can occupy more than one byte.
Enter the original password and paste the existing bcrypt hash into the verification tool. Click Verify Password to check whether they match.
Yes. A standard bcrypt hash includes its version, cost factor, salt and digest. You do not need to store a separate salt when using the standard bcrypt password-hashing format.
Bcrypt is designed for password storage and is intentionally slower than SHA-256. SHA-256 alone should not be used to store user passwords. Argon2id is generally preferred for new password storage systems when available.
The generator and verifier operate in your browser. They do not submit password fields to this PHP page or save entered passwords in a Permitir.net database. The bcrypt.js library is loaded from a public CDN. Avoid entering real production credentials into any online tool.
Bcrypt is supported by PHP's native password hashing API. PHP applications can generate hashes with password_hash() and verify them with password_verify(). Always test interoperability with your target application and its bcrypt implementation.