Bcrypt processes at most 72 bytes of password input—not necessarily 72 characters. Depending on the library, a longer password may be rejected or silently truncated, so the same long password can behave differently across applications. Check how your implementation handles the limit before setting password rules or changing password-storage code.
What is bcrypt’s maximum password length?
Bcrypt’s maximum effective input is 72 bytes. The Go crypto project documents that GenerateFromPassword rejects passwords longer than 72 bytes, while the Java bcrypt implementation describes 72 bytes as the absolute maximum, equivalent to 18 32-bit words.
The limit applies to the encoded bytes passed to bcrypt. It is not a universal 72-character limit.
Why 72 bytes is not always 72 characters
Text is encoded into bytes before it is processed. In UTF-8, some visible characters use multiple bytes, so a password containing non-ASCII characters can reach 72 bytes with fewer than 72 characters. Measure the byte sequence produced by the same character encoding used by the verifier, rather than counting displayed characters or Unicode code points.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problems#1 Best Overall
- POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
Also establish whether the application normalizes text before encoding it. Registration, login, reset, import, and migration must apply the same encoding and normalization rules or credentials can stop matching.
What happens when a password exceeds the limit?
Behavior depends on the bcrypt implementation. Go’s GenerateFromPassword returns ErrPasswordTooLong for inputs over 72 bytes. Flask-Bcrypt and Passlib document behavior that ignores or truncates bytes after the limit. Consult the documentation for the exact library and version deployed; do not assume every implementation rejects long input.
Rank #2
- Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T120. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
- Certified with the new FIDO2 standard, T120 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
- Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
- Fits USB-C port : Insert the T120 security key into the USB-C port of each service and log in conveniently with one touch
- For the driver download and user guide, please visit TrustKey Solutions Home support page.
With silent truncation, two passwords that share their first 72 bytes but differ afterward are treated as the same bcrypt input. Passlib also documents truncation at the first NULL byte, so embedded-NUL behavior needs explicit compatibility testing.
How to handle the limit in an application
- Measure after encoding. Determine the byte length using the verifier’s actual character encoding and normalization policy.
- Choose a deliberate over-limit rule. Reject passwords over 72 bytes, or adopt a documented preprocessing scheme. Avoid silently relying on a library’s truncation behavior without accounting for its consequences.
- Apply one rule everywhere. Registration, login, password reset, account import, and migration must use compatible handling.
- Test boundary and compatibility cases. Include inputs of 71, 72, and 73 bytes; multibyte UTF-8 text near the boundary; embedded NUL bytes; and pairs that share the first 72 bytes but differ afterward.
- Record the implementation details. Track the deployed library and version, over-limit behavior, encoding and normalization rules, NUL handling, bcrypt prefix support such as
2aor2b, configurable work factor, and any pre-hash compatibility mode.
Re-test these cases when upgrading the bcrypt library: implementations and versions may not handle long inputs identically.
Rank #3
- ✅ PROTECT ONLINE ACCOUNTS – A password manager, two-factor security key, and secure communication token in one, OnlyKey can keep your accounts safe even if your computer or a website is compromised. OnlyKey is open source, verified, and trustworthy.
- ✅ UNIVERSALLY SUPPORTED – Works with all websites including Twitter, Facebook, GitHub, and Google. Onlykey supports multiple methods of two-factor authentication including FIDO2 / U2F, Yubico OTP, TOTP, Challenge-response.
- ✅ PORTABLE PROTECTION – Extremely durable, waterproof, and tamper resistant design allows you to take your OnlyKey with you everywhere.
- ✅ PIN PROTECTED – The PIN used to unlock OnlyKey is entered directly on it. This means that if this device is stolen, data remains secure, after 10 failed attempts to unlock all data is securely erased.
- ✅ EASY LOG IN –No need to remember multiple passwords because by plugging OnlyKey to your computer, it automatically inputs your username and password. It works with Windows, Mac OS, Linux, or Chromebook, just press a button to login securely!
Can you pre-hash a long password before bcrypt?
Pre-hashing changes the password-storage scheme; it is not a transparent fix for existing bcrypt hashes. Flask-Bcrypt documents a SHA-256 preprocessing workaround, but switching an existing system to that approach can make current passwords fail verification unless the application distinguishes the old and new schemes and handles migration deliberately.
If adopting preprocessing, specify the exact transformation and apply it consistently at enrollment and verification. Preserve a path for checking existing hashes, then migrate credentials in a controlled way rather than changing the transformation in place.
Rank #4
- ✅ PROTECT ONLINE ACCOUNTS – A password manager, two-factor security key, and secure communication token in one, OnlyKey can keep your accounts safe even if your computer or a website is compromised. OnlyKey is open source, verified, and trustworthy.
- ✅ UNIVERSALLY SUPPORTED – Works with all websites including Twitter, Facebook, GitHub, and Google. Onlykey supports multiple methods of two-factor authentication including FIDO2 / U2F, Yubico OTP, TOTP, Challenge-response.
- ✅ PORTABLE PROTECTION – Extremely durable, waterproof, and tamper resistant design allows you to take your OnlyKey with you everywhere.
- ✅ PIN PROTECTION – Locking your device means that if this device is stolen, data remains secure, after 10 failed attempts to unlock all data is securely erased.
- ✅ EASY LOG IN – No need to remember multiple passwords because by plugging OnlyKey to your computer, it automatically inputs your username and password. It works with Windows, Mac OS, Linux, or Chromebook, just press a button to login securely!
What should you use for new password storage?
OWASP recommends Argon2id when available. For legacy systems that continue to use bcrypt, its Password Storage Cheat Sheet advises a work factor of 10 or more and a 72-byte password limit. The work factor and input limit address different concerns: the first controls bcrypt’s computational cost, while the second constrains its input.
Sources: Go bcrypt documentation; Go error documentation; patrickfav/bcrypt documentation; Flask-Bcrypt documentation; Passlib bcrypt documentation; OWASP Password Storage Cheat Sheet.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteQuick Recap
Best Value
- Ultra-Compact FIDO2 Security Key - Plug-and-stay or carry on a keychain. This USB-A hardware security key offers portable, always-on protection for desktop and mobile use. (Item Size: 0.75 X 0.74 IN x 0.25 IN)
- USB-A Hardware Key for All Devices - Works with USB-A ports on PC, Mac, Android, and other laptop/notebook device. Enables secure, cross-platform login with FIDO2.0 passkey support.
- FIDO Certified Security Key - Meets FIDO and FIDO2 standards. Works with Google, Microsoft, GitHub, Dropbox, and more. Please check service compatibility before purchase.
- Passwordless Login with Passkey - Supports passkey login via WebAuthn and CTAP2. Enjoy password-free sign-ins where supported. Not all websites or services currently support passkeys.
- Advanced Multi-Factor Authentication - Offers 200 FIDO2 passkey slots and 50 OATH-TOTP slots. Strong, flexible 2FA/MFA support across various apps and authentication platforms.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

