Bcrypt Hash Generator & Verifier

Generate bcrypt password hashes at any cost factor and verify passwords against existing hashes, with the salt and cost behaviour explained.

Everything runs in your browser — passwords and hashes never leave this page. Each hash embeds a random salt, so hashing the same password twice gives different (equally valid) hashes: that is bcrypt working as designed. Cost 10–12 is the common production range in 2026; each +1 doubles the work for you and for an attacker. High costs (13–14) can take seconds in a browser tab.

bcrypt reads 72 bytes and throws the rest away

The limit comes from the Blowfish key schedule bcrypt is built on, and it is measured in bytes after the text is encoded — not in characters. Seventy-two letters fit exactly; the seventy-third is discarded, silently, by both the hasher and the verifier. Two passwords sharing a 72-byte prefix produce the same hash and verify each other, and nothing anywhere says so.

PasswordBytesBytes discarded
72 letters 72 none
73 letters 73 1
100 letters 100 28
18 emoji 72 none
19 emoji 76 4

A generated hundred-character password loses its last twenty-eight characters entirely — which makes this a problem for exactly the people who thought they were being careful. A passphrase of a dozen ordinary words is usually well under the limit and is fine. The cut never leaves half a character behind, and anything short passes through untouched.

Which means eighteen emoji and nineteen emoji are the same password

Because the limit is in bytes, it arrives sooner for anything outside the Latin alphabet. A password in a wider script runs out of room while it still looks short:

ScriptBytes per characterCharacters that fit
ASCII letters 1 72
Accented Latin (é) 2 36
Chinese (漢) 3 24
Emoji (🔒) 4 18

Eighteen emoji are exactly 72 bytes, so a nineteenth is invisible: hash the eighteen-emoji password and the nineteen-emoji one verifies against it. Not similar — identical. A password in Chinese hits the cap at twenty-four characters where an ASCII one has seventy-two to play with. All four widths happen to divide 72 exactly, which is a coincidence of 1, 2, 3 and 4 rather than a design.

Fewer characters is not automatically less security, though, because a character drawn from a larger set carries more of it. Putting rough alphabet sizes against each cap — assumptions rather than measurements, so treat these as illustrative: 72 ASCII letters at about 473 bits, 36 Accented Latin at about 275 bits, 24 Chinese at about 283 bits, 18 Emoji at about 195 bits. ASCII does allow the most, since one byte per character goes furthest — but by 2.4×, not the 4× the character counts imply. The ordering is not the character ordering either: Chinese fits fewer characters than accented Latin and carries more, because it is choosing from a far larger set. Every one of those caps clears the 186 bits the digest itself carries, though the emoji one only just — about 9 bits of headroom. So the truncation is a correctness surprise, two passwords you believe are different turning out not to be, rather than a security ceiling anyone was pressed against.

The cost number is an exponent, not a count

Cost 12 does not mean twelve of anything. It means 212 = 4,096 rounds of key setup, so every notch on the slider doubles the work.

CostRoundsRelative to cost 10
8 256 1/4×
10 1,024
11 2,048
12 4,096
14 16,384 16×
16 65,536 64×

Two notches is always four times the work wherever you start, and cost 16 is sixty-four times cost 10. That asymmetry is the entire point of the design: a hash taking a quarter of a second is barely noticeable at a login prompt and ruinous to somebody trying a billion guesses. The attacker and the user pay the same multiplier, and only one of them is paying it once.

Every setting travels inside the hash

A bcrypt hash is 60 characters and every part of it is readable: 7 for the version and cost, 22 of salt, 31 of digest.

PartCharactersFrom the example
Version and cost7$2b$06$
Salt2242U7zduxD00ckk6zr0TBSe
Digest318qPvPUg/OcGZrTliicqKwHWGPf4s8Pa

Because the salt rides along, verifying needs nothing but the password and the string — and hashing the same password twice gives two different 60-character results that both verify. If two users' hashes ever match, they did not merely choose the same password; something is wrong with the salt. Those 22 characters carry 128 bits. One last trap: bcrypt encodes with its own 64-character alphabet starting "./" where standard Base64 starts "AB". Paste a bcrypt hash into a general Base64 decoder and you get nonsense, and that is why.

How to use

  1. Enter a password and pick a cost factor.
  2. Generate the hash.
  3. Verify an existing hash by entering it with the password.
  4. Raise the cost factor as hardware improves.

Frequently asked questions

Why bcrypt rather than SHA-256?

Because bcrypt is deliberately slow and adjustably so. General hashes are optimised for speed, which helps an attacker guessing billions of candidates per second. Bcrypt's cost factor lets you make each attempt as expensive as your server can tolerate, and that cost applies to the attacker too.

What is the cost factor?

A base-two exponent controlling how much work each hash takes — raising it by one doubles the time. Values around 12 are a common current choice, but the right number is whatever keeps verification tolerable on your hardware, and it should rise over the years as machines get faster.

Where is the salt?

Inside the hash string. Bcrypt generates a random salt automatically and stores it in the output alongside the cost factor and the hash itself, which is why the same password produces a different result every time and why you never need a separate salt column.

Why does the same password give a different hash each time?

Because of that random salt, and it is a feature rather than a fault. It means identical passwords across accounts do not produce identical hashes, so a breach does not reveal which users share a password, and precomputed rainbow tables are useless.

Is bcrypt still the best choice?

It is a sound one and widely supported. Argon2 won the 2015 Password Hashing Competition and resists specialised hardware better because it is memory-hard, so it is generally preferred for new systems where a good implementation is available. Bcrypt remains far better than any general-purpose hash.

What is bcrypt's length limit?

It truncates input beyond 72 bytes, silently. Long passphrases therefore gain nothing past that point, and pre-hashing before bcrypt is the usual workaround — though it must be done carefully, since a naive version can introduce a null-byte problem of its own.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.