bcrypt · 72-byte limit

bcrypt hash generator

Hash a password at a cost you pick, or check one against a hash you already store — with the truncation rule stated, not hidden.

Only the first 72 bytes are used; the result says when that happened.

Hashing runs in this tab. A password typed here is never sent anywhere, which is the only reason a browser page should ask for one.

Short answer: pick a cost, type the password, run. Verification works the other way round: paste the stored hash and the password, and the page compares them.

Why bcrypt, and why the cost matters

bcrypt is deliberately slow, and the cost factor sets how slow. That slowness is the defence: an attacker with a GPU can test billions of fast hashes per second, but only a few thousand bcrypt guesses. Raising the cost by one doubles the work for everyone, including you.

The 72-byte rule

Input past 72 bytes is ignored. A 100-character passphrase and its first 72 characters hash identically — the page reports it rather than pretending the whole string was hashed. If you need longer input, pre-hash it (for example SHA-256 then base64) before bcrypt, and be aware that changes the format other systems expect.

Generating a password to hash? Therandom string generator makes one locally.

bcrypt questions

Which cost factor should I use?

One where verification takes about 100 ms on the hardware that will do the checking — commonly 10 to 12 today. The page times the hash on your device so you can see the real number. A cost set on a laptop may be far too slow on a small server, and the reverse is the usual mistake.

Why does a very long password give the same hash as its first 72 bytes?

Because bcrypt only reads 72 bytes. Two passwords that share the first 72 bytes produce the same hash, so the page reports when it truncated instead of letting you believe the whole password was used.

Where is the salt?

Inside the hash string. A bcrypt hash carries its own algorithm marker, cost and 16-byte salt, so storing the output is enough — there is no separate salt column to keep in sync.

Does a match mean the password is good?

No. It means this password reproduces this hash. Strength is a separate question about length, reuse and whether the password appears in a breach corpus — this page measures none of those.

Related tools