Example
Input (password + cost)
Password: password Cost (rounds): 10
Output (bcrypt hash)
$2b$10$28n.1hWw0joAn/1WS1BhB.aHwErO/XE0ENEaYoTECAdR5Wet.2CIi
Note
`$2b$` is the algorithm version, `10` is the cost factor (2¹⁰ = 1024 rounds). The hash embeds salt + cost, so verification needs no separate storage.
Usage / FAQ
When to use
- Generate password hashes for storage (learning / testing)
- Inspect the cost factor of an existing bcrypt hash
- Verify whether a candidate password matches a stored hash
- Tune cost — target ~100ms server-side per hash
- Compare with argon2 and scrypt while learning
FAQ
- Q.What cost factor should I use?
- A.As of 2026, cost ≥ 12 is recommended — about 250ms per hash on a typical server. Mobile devices can stick with 10. Each +1 doubles the time.
- Q.Why bcrypt instead of SHA-256?
- A.SHA is too fast — GPUs can compute billions of hashes per second. bcrypt is deliberately slow (tunable cost) and auto-generates a fresh salt for every hash.
- Q.Isn't argon2 better?
- A.Yes — argon2id won the 2015 Password Hashing Competition and is memory-hard, so it resists GPU attacks. For new projects argon2id is preferred. bcrypt still wins on library availability across languages and DBs.
Fun facts
bcrypt traces back to Niels Provos and David Mazières's 1999 USENIX paper 'A Future-Adaptable Password Scheme.' The core idea — 'just bump the work factor when hardware gets faster' — has held up for 25 years and counting.
USENIX 1999 — Provos & Mazièresbcrypt uses 'eksblowfish' (Expensive Key Setup Blowfish), a deliberately slowed-down Blowfish key schedule. It bottlenecks on the 4 KB internal cache and memory latency rather than raw ALU speed, which is why it resists GPU/ASIC attacks better than SHA-family hashes.
Wikipedia — bcryptThe `$2a$` `$2b$` `$2y$` prefixes are all the same algorithm at different revisions. A 2011 sign-extension bug in PHP's bcrypt implementation forced a `$2x$`/`$2y$` split, and OpenBSD later moved from `$2a$` to `$2b$`. Libraries accept every prefix on verify.
Openwall — bcrypt sign-extension bug
Related guides
- Password Hashing Done Right — bcrypt, Argon2, and What Not to Do
Why you can't store passwords with SHA-256, what makes bcrypt and Argon2 different, how to pick cost parameters, peppering, and migrating between algorithms.
- How SHA Hashes Are Built
A guided tour through cryptographic hashes — what makes a function one-way, the Merkle-Damgård and sponge constructions behind SHA-2 and SHA-3, why MD5/SHA-1 are broken, and why fast hashes are wrong for passwords.
- How Authentication Actually Works (Session, JWT, OAuth, Passkey)
Session cookies vs JWT vs OAuth flows vs passkey — what each model actually stores, where the trust lives, why refresh tokens exist, and how passkeys replace passwords entirely with WebAuthn.
- How Encryption Actually Works
Symmetric (AES) vs asymmetric (RSA / ECC), why you never see RSA encrypting a file (hybrid encryption), block cipher modes (ECB pitfall vs GCM), key derivation (PBKDF2 / Argon2), at-rest vs in-transit, and the never-roll-your-own-crypto rule.
Related tools
- Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text. Runs entirely in your browser, no data sent to any server.
- URL Encode / Decode
Percent-encode text for safe use in URLs, or decode percent-encoded URLs back to text. Runs entirely in your browser.
- UUID / ULID Generator
Generate UUID v4 (random), UUID v7 (time-ordered, RFC 9562), or ULID identifiers — all client-side via crypto.
- JWT Decoder
Decode the header and payload of a JSON Web Token. Signature is not verified (a public key is required). The token is processed entirely in your browser.
- JWT Encoder (HMAC)
Generate a signed JSON Web Token with HS256/HS384/HS512 (HMAC-SHA). Payload and secret stay in your browser — Web Crypto API based.
- SHA Hash
Compute SHA-1, SHA-256, SHA-384, or SHA-512 hash of text. Uses the browser's Web Crypto API; no data is sent to any server.
- Hex Encode / Decode
Encode text to hexadecimal or decode hex back to text. Supports UTF-8 multi-byte characters and tolerates whitespace.
- HTML Entity Encode / Decode
Encode HTML special characters (&, <, >, ", ') to entities, or decode named/numeric entities back to text.
- Password Generator
Generate cryptographically strong passwords, tokens, random strings, and passphrases with entropy display.
- Number Base Converter
Convert numbers between bases (binary/octal/decimal/hex/base36) using BigInt for large integers. Auto-detects 0b/0o/0x prefixes.
- URL Parser
Decompose a URL into protocol, host, path, query parameters, and hash — read-only inspection.
- HMAC Generator
Compute HMAC (Hash-based Message Authentication Code) with SHA-1/256/384/512 using the Web Crypto API.
- HMAC Verify
Verify whether a given HMAC signature matches the message + secret. Constant-time comparison via Web Crypto API.
- MD5 Hash
Compute MD5 hash for text. Note: MD5 is broken for security — checksums and legacy compatibility only.
- Punycode (IDN)
Convert international domain names to/from Punycode (xn-- encoded ASCII). Uses native URL parser.
- HTTP Status Codes
Browse and search HTTP status codes (1xx-5xx) with descriptions and common usage.
- User-Agent Parser
Parse User-Agent strings into browser, OS, device, and engine fields.
- Cookie Parser
Parse Cookie or Set-Cookie strings into a table. Decode percent-encoded values. Supports Set-Cookie attributes (Path/Domain/Max-Age/SameSite/HttpOnly/Secure).
- IP / CIDR Calculator
Compute network address, broadcast, host range, mask, and host count from an IPv4 + CIDR.
- cURL Builder
Build cURL commands from URL/method/headers/body. Auto-detects JSON content-type.