Bcrypt Password Hasher and Salt Verifier
Generate bcrypt hashes with custom work factors, parse the embedded salt, verify passwords, and measure real computation delays - entirely client-side.
The Complete Guide to Bcrypt Password Hashing
If you are building an application that stores user passwords, Bcrypt is one of the best-validated choices available. This guide explains not just how to use this tool, but why Bcrypt works the way it does - and what those timing numbers you see actually mean for your security posture.
How to Use This Tool
Start in Panel A. Type any password into the Plaintext Password field (the eye icon toggles visibility). Set the Work Factor slider - 10 is the OWASP-recommended minimum for most applications. Click "Compute Hash" and wait: the spinner shows the CPU is actively working. When done, the full Bcrypt hash appears in a copyable code block, along with the exact millisecond duration of the operation. The Hash Anatomy section below it breaks the output string into its four components.
To verify a password against a known hash, paste the hash into Panel B's "Hash to Verify" field, type the candidate password, and click "Verify Hash." You will see either a green "Valid Match" or a red "Invalid Hash" indicator, both with their own timing measurement. Critically, valid and invalid verifications take the same amount of time - this is deliberate timing-attack resistance built into Bcrypt.
Reading the Bcrypt Output String
A Bcrypt hash like $2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy has four parts separated by dollar signs. The algorithm identifier (2a, 2b, or 2y) specifies the Bcrypt version. The cost (10) is the log-base-2 work factor. The remaining 53 characters encode the 16-byte salt (22 chars in Bcrypt's modified Base64) and the 24-byte hash digest (31 chars) concatenated together. This self-contained format is intentional: one string has everything needed to verify the password later without consulting any external table.
Why the Timing Numbers Matter
The milliseconds shown under each operation are not a performance metric to minimize - they are a security metric to maximize. A hash that takes 100ms means an attacker limited to one machine can try roughly 10 passwords per second. Across a GPU cluster that could normally crack MD5 at billions of hashes per second, the attacker is effectively stopped. Observe how each increase of 1 in the cost slider doubles the time: that is exponential growth working in your favor. Benchmark different cost factors on your target server hardware using this tool, then choose the highest value your response time budget allows.
Client-Side vs. Server-Side Hashing
This tool hashes entirely in your browser using the bcryptjs library - nothing leaves your machine. This is safe for exploration and testing. In a real application, however, password hashing must happen server-side. If you hash on the client and send the hash to the server, the hash itself becomes the credential. An attacker who steals your hash database can authenticate directly without ever knowing the original password. The browser should send the raw password over HTTPS; the server should hash it, then store only the hash.