🔐 bcrypt Hash Info
Parse and analyze bcrypt password hashes. View version, cost factor, salt, and hash digest components.
About the bcrypt Hash Info tool
This tool parses a bcrypt password hash and breaks it into its component parts: the version identifier, cost factor, salt, and hash digest. Paste a hash above and click Analyze to inspect its structure. Everything runs locally in your browser — nothing is uploaded.
bcrypt hash format
A bcrypt hash follows the Modular Crypt Format, structured as $version$cost$salt+hash. Here is a breakdown of each field:
- Version —
$2a$,$2b$,$2y$, or$2x$. The2bvariant is the current standard (OpenBSD).2ais the original;2yis used by some PHP implementations;2xis a legacy variant with a known bug. - Cost factor — A two-digit number between 04 and 31. The hash function runs
2^costiterations. A value of 12 means 4,096 rounds. Higher cost = slower hashing = more resistant to brute force. - Salt — 22 characters from bcrypt's custom base64 alphabet (
./A-Za-z0-9), encoding a 128-bit random salt. - Hash digest — 31 characters from the same alphabet, encoding the 184-bit output of the Blowfish-based key derivation.
Total length
A complete bcrypt hash is 60 characters long: $2b$ (4) + 12 (2) + $ (1) + 22-char salt + 31-char digest = 60. Some databases store a leading $ or trailing data, so values between 59 and 60 characters are common.
Choosing a cost factor
The cost factor directly controls how long each verification takes. As a rule of thumb, set it so a single hash takes roughly 250–500 ms on your production hardware:
- Cost 10 — ~1,024 rounds. Fast, but increasingly weak for modern attackers with GPUs.
- Cost 12 — ~4,096 rounds. A common default in many frameworks as of 2024.
- Cost 14 — ~16,384 rounds. Strong but adds noticeable latency under high load.
- Cost 31 — Maximum. Impractically slow for production use; reserved for high-security offline scenarios.
Re-raise the cost periodically as hardware improves. bcrypt allows re-hashing on login by detecting a higher desired cost and re-encoding with a fresh salt.
Why bcrypt?
bcrypt is a password hashing function designed by Niels Provos and David Mazières in 1999. Unlike plain SHA-256, it is intentionally slow and uses a tunable cost factor, so it remains resistant to brute force even as hardware speeds up. The embedded salt prevents rainbow table attacks and ensures that identical passwords hash to different values. For modern password storage, bcrypt, scrypt, and Argon2 are the recommended choices.
Frequently asked questions
Does this tool generate bcrypt hashes? No — it only parses and analyzes existing hashes. Generating bcrypt requires running the Blowfish cipher thousands of times, which needs a dedicated implementation rather than the Web Crypto API.
Can I recover the password from a bcrypt hash? No. bcrypt is a one-way function. The only way to "crack" it is to try candidate passwords one by one, which is exactly what the cost factor makes expensive.
Is the salt secret? No. The salt is intentionally stored in the clear as part of the hash. Its purpose is to make each hash unique, not to be secret. You can safely share a bcrypt hash — it remains computationally expensive to attack.
What does "estimated compute time" mean? It's a rough approximation of how long one verification takes on a modern CPU, based on the cost factor. Real performance varies with hardware and implementation.
Which variant should I use? For new applications, generate hashes with $2b$ and a cost factor of 12 or higher. Avoid $2x$ due to a known sign-extension bug.