How to use this bcrypt generator online
This bcrypt generator does two jobs on one page. In the Generate section you type a test password, choose a cost factor from 4 to 12 with the slider, and press Generate Hash. The page loads the public bcryptjs library from the jsDelivr content delivery network, creates a fresh random salt, runs the bcrypt algorithm entirely inside your browser tab, and shows the complete hash — always 60 characters — together with its cost and version, plus a copy button. In the Verify section you paste a password and an existing hash, and bcrypt compare tells you plainly whether they match. Nothing you type is sent to FreeSoftis or to any other server, and nothing is stored: close the tab and both the password and the hash disappear with it.
When you need a record, Copy puts a short plain-text result on your clipboard and Download .txt saves the same record as bcrypt-result.txt. The record contains the hash, its cost and length, or the verify verdict — it never contains the password you typed, because a report that carried passwords around would defeat the entire point of hashing them.
What bcrypt is and how a bcrypt hash is built
People searching for bcrypt encrypt usually mean bcrypt hashing, and the difference matters. Encryption is a two-way street: data encrypted with a key can be decrypted with that key, which is exactly what you want for a message and exactly what you do not want for a password store. If a database of encrypted passwords leaks together with its key, every password falls at once. Hashing is a one-way street. A password hashing function turns a password into a fixed-looking string from which the password cannot be recovered; to check a login attempt, the system hashes the attempt and compares the two hashes. Bcrypt was designed specifically for that job, at a time when general-purpose hashes like MD5 were already visibly too fast to protect passwords.
Inside bcrypt sits Blowfish, a cipher designed by Bruce Schneier, used in an unusual way. Bcrypt first runs an expensive key setup — often called EksBlowfishSetup — that mixes the password and a 128-bit random salt through many rounds of expansion. The cost factor sets how many rounds: the work doubles with every step, so cost 10 means 2 to the power of 10 rounds of setup, cost 11 twice that, and so on. After the setup, bcrypt encrypts a fixed piece of text — the 24-byte string OrpheanBeholderScryDoubt — 64 times, and the result becomes the hash value. That odd fixed text is simply a constant of the algorithm; what makes each hash unique is the salt and the password feeding the setup before it.
The salt deserves its own paragraph, because it quietly defeats two entire classes of attack. Because the salt is random and different for every hash, the same password never produces the same hash twice — try it above: generate twice and compare the strings. That kills rainbow tables, the precomputed lookup tables that make unsalted fast hashes so fragile, because a table built for one salt is useless for another. It also hides password reuse inside a leaked database: two users who chose the same password still get unrelated hashes, so an attacker cannot even see who shares a password, let alone crack them in bulk.
How to verify a hash with bcrypt compare
Verification — the operation most libraries simply call compare — is where bcrypt's self-describing format pays off. A bcrypt hash string carries everything verification needs: the algorithm version, the cost factor and the salt are all written inside the string itself, before the hash value. So bcrypt compare needs only two inputs, the password being tested and the stored hash. It reads the salt and cost out of the hash, runs the same expensive setup on the candidate password, produces a new hash, and checks whether the two strings match. Match means the password is the one that was hashed; no match means it is not. There is no separate salt column to store in a database and no configuration to keep in sync.
Anatomy of a bcrypt hash string
Every hash this bcrypt hash generator produces is exactly 60 characters, and each part earns its place. Reading one left to right is the fastest way to understand what you are storing.
| Part | Example | What it means |
|---|---|---|
| Prefix and version | $2b$ | The algorithm marker. $2a$ is the original, $2b$ fixed a rare bug in one implementation, and $2y$ is the same fix under the PHP naming. This page's library emits $2a$. |
| Cost factor | 10 | Two digits giving the work factor. The setup runs 2 to the power of this number of rounds, so 12 costs four times as much as 10. |
| Salt | 22 characters | 128 bits of random data in bcrypt's own base64 alphabet. Generated fresh for every hash and stored in the open — a salt is not a secret. |
| Hash value | 31 characters | The output of the bcrypt computation — 23 bytes of the final encrypted constant, encoded in the same alphabet. |
Cost factor: choosing 4 to 12 and beyond
The cost factor is a dial between your users' patience and an attacker's budget. Turn it too low and a leaked database falls quickly; turn it too high and your own login page becomes the denial-of-service attack. The table below gives approximate single-hash times on a typical modern laptop or server core. Treat them as orders of magnitude, not promises: phones are slower, high-end servers faster, and the JavaScript library on this page is slower than the optimised native code a backend would run — which is itself a useful lesson in why production hashing belongs on the server.
| Cost | Rounds (2^cost) | Approx. time per hash | Sensible use |
|---|---|---|---|
| 4 | 16 | A few milliseconds | Unit tests and fixtures only — far too fast for real passwords |
| 6 | 64 | Roughly 10–20 ms | Fast test suites, throwaway demos |
| 8 | 256 | Roughly 50–70 ms | Lightweight apps, older guidance minimums |
| 10 | 1,024 | Roughly 200–300 ms | The common default — a good balance for most applications |
| 11 | 2,048 | Roughly 0.5 s | A step up for newer hardware |
| 12 | 4,096 | Roughly 1 s | Common production ceiling; measure login load before adopting |
| 13–14 | 8,192–16,384 | Roughly 2–4 s | High-value systems with measured capacity; this page's slider stops at 12 |
This page offers 4 to 12 because that range covers learning, testing and the realistic production band, while keeping a browser tab responsive. The right way to choose in a real system is measurement, not folklore: pick a target verification time — OWASP's guidance frames it as making hashing as expensive as your hardware and login rate allow — benchmark on the machine that will actually serve logins, and revisit the number as hardware improves. And remember what the cost cannot do: it multiplies the price of every guess equally, so it slows an attacker trying a dictionary — it does not rescue the password that is first in that dictionary.
Worked examples, checked step by step
Example one: generation. Take the classic test phrase correct horse battery staple and generate at cost 10. Three things will always be true of the result, and you can check each one on this page. The hash is 60 characters long. It starts with the version and cost you chose, in the form $2a$10$. And if you generate again with the identical password and cost, the new hash is completely different — yet pasting either hash into the Verify section with the same phrase returns match both times. That pair of facts, different every time and always verifiable, is salting made visible.
Example two: a known test vector, so you do not have to take the library on faith. Cryptographic test vectors are published input-and-output pairs that any correct implementation must reproduce. For bcrypt, hashing the three-character password U*U with the fixed salt $2a$05$CCCCCCCCCCCCCCCCCCCCC. must produce exactly $2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW. The bcryptjs build used by this page was checked against that vector in a Node test before this page was published, and it matched character for character — as did the format check that a cost-10 hash of the word password matches the 60-character pattern, and the compare checks that the right password verifies and a wrong one does not. A generator that cannot reproduce a public vector is not implementing bcrypt, whatever its interface claims.
Bcrypt vs Argon2, scrypt and SHA-256
Bcrypt is not the only password hashing function, and choosing honestly means knowing the field. The short version: for new systems, current OWASP guidance puts Argon2id first; bcrypt remains an approved, battle-tested alternative; and fast general-purpose hashes such as SHA-256 — however excellent for other jobs — must never store passwords.
| Function | Designed for passwords? | Memory-hard? | Honest verdict |
|---|---|---|---|
| Argon2id | Yes — Password Hashing Competition winner, 2015 | Yes — tunable memory, time and parallelism | First choice for new systems per OWASP; standardised in RFC 9106 |
| bcrypt | Yes — 1999, Blowfish-based | No — modest fixed memory, which modern GPUs handle well | Still acceptable per OWASP with cost 10+; everywhere, simple, one self-describing string |
| scrypt | Yes — 2009 | Yes — memory hardness was its founding idea | Sound where well supported; parameter tuning is easier to get wrong |
| PBKDF2 | Yes — older standard, FIPS-approved contexts | No | Acceptable mainly where compliance requires it; needs very high iteration counts |
| SHA-256 / SHA-512 | No — general-purpose fast hashes | No | Never for passwords: billions of guesses per second on commodity GPUs |
Bcrypt's genuine weakness is memory: it uses only a few kilobytes, so modern graphics cards and dedicated hardware can run many bcrypt computations in parallel, eroding some of its cost advantage. Argon2id answers that by demanding large amounts of memory per guess, which parallel hardware cannot cheaply provide. What bcrypt still offers is ubiquity and simplicity — every major language and framework ships it, its single-string format is hard to misuse, and a quarter-century of scrutiny has found no practical break of the algorithm itself. A correctly configured bcrypt deployment protects real systems today; an Argon2id deployment is the better default when you are starting fresh and your stack supports it well.
The 72-byte limit and other honest limits
Bcrypt uses only the first 72 bytes of a password. Anything beyond that is silently ignored, so two passwords that share their first 72 bytes hash identically — a real, documented property of the algorithm, not a bug in this page. Note the unit: bytes, not characters. A password of 40 characters full of accented or non-Latin letters can pass 72 bytes sooner than its character count suggests, because such characters take two to four bytes each in UTF-8. This page warns you when an entry exceeds 72 bytes, and well-built applications either enforce the limit openly or pre-hash in a carefully reviewed construction rather than discovering the truncation in production.
The other limits deserve the same plainness. A hash of a weak password can still be cracked: bcrypt raises the cost per guess, but an attacker with the leaked hash and a good dictionary will still find password123 — the function protects the storage, not the choice. Bcrypt hashes also cannot be upgraded in place; raising security means verifying with the stored cost and re-hashing on the next login. The JavaScript library on this page is a faithful implementation but a slow one compared with native server libraries, and it arrives from a public CDN — if that file cannot load, this page says so and produces nothing, rather than falling back to something weaker. And the deepest limit of all: this is a testing and learning tool. Production passwords must be hashed inside your own application, with a maintained library, on infrastructure you control.
What people use a bcrypt hash generator for
- Seeding test and development databases. Creating realistic password hashes for fixture users without ever storing a plaintext password, even in a throwaway environment.
- Learning how password storage works. Watching salting, cost and the 60-character format behave live makes the concepts concrete in a way reading about them does not.
- Debugging login problems. Using bcrypt compare as a neutral referee: does this password actually match the hash in the database, yes or no?
- Checking hashes across systems. Confirming that a hash produced by one stack — a PHP app, a Python script — verifies correctly in another.
- Demonstrating cost to a team. Timing cost 6 against cost 12 on real hardware settles configuration arguments faster than any document.
- Validating a library or migration. Generating known values, including published test vectors, to prove a new implementation behaves before it touches real accounts.
Storing hashes safely in a real application
If this page is your starting point for building a login system, carry these rules with you. Hash on the server, inside a maintained library for your language — never write your own bcrypt implementation and never hash client-side as your only layer, because the hash then effectively becomes the password for anyone who intercepts it. Store the single hash string in one column; the format already carries version, cost and salt. Choose the cost by benchmarking your own servers, targeting roughly a quarter of a second per verification, and build the re-hash-on-login path so you can raise it later. Add rate limiting and breached-password screening at login, because hashing alone cannot stop an attacker trying common passwords against the live form. And protect the database itself as if it were sensitive — it is: a leaked hash file invites offline guessing at the attacker's pace, on the attacker's hardware.
Privacy, safety warnings and sources and references
The privacy claim on this page is specific and checkable: hashing happens 100% in your browser, performed by the public bcryptjs library loaded from the jsDelivr CDN, and no password or hash is transmitted to FreeSoftis. The safety warning is equally specific: never enter a real production password — or any password you actually use — on this or any other website; use invented test values only. Bcrypt truncates at 72 bytes, and a hash of a weak password can still be cracked, as the limits section explains.
One source note in the open: this guide set out to cite the npm page for bcryptjs, but that page returned a 403 response to our automated availability check, so the library is cited by its GitHub home instead — the same project, by the same author — and every source below was verified as reachable before publication.
- Provos and Mazieres — A Future-Adaptable Password Scheme (USENIX 1999) — the original bcrypt paper: the expensive key setup, salting and the argument that a password scheme must grow costlier as hardware improves.
- OWASP — Password Storage Cheat Sheet — current practical guidance: Argon2id first, bcrypt acceptable at cost 10 or above, and why fast hashes must never store passwords.
- bcrypt.js on GitHub (dcodeIO) — the project home of the bcryptjs library this page loads from CDN, substituted for its npm page, which returned 403 to our availability check.
- Wikipedia — Bcrypt — a readable overview of the algorithm, its hash format, version markers $2a$, $2b$ and $2y$, and the 72-byte limit.
- NIST SP 800-63B — Digital Identity Guidelines: Authentication and Lifecycle Management — the US standard covering memorised secrets, salted hashing and verifier requirements.
- RFC 9106 — Argon2 Memory-Hard Function — the IETF specification of Argon2, the modern alternative this guide compares bcrypt against.
- OWASP — Authentication Cheat Sheet — the wider login-security picture around password storage: rate limiting, recovery flows and generic error messages.