Bcrypt Generator
Generate bcrypt using the options shown.
About Bcrypt Generator
Developers need bcrypt hashes when seeding an admin account, writing a database migration, or setting a password directly in a users table during testing. Generating one here lets you paste a valid hash into SQL or a fixture without writing a script. Your application must already verify passwords with bcrypt.
How it works
Hashing uses the bcryptjs 2.4.3 library, loaded from a CDN, through its synchronous hashSync function. A new random salt is generated on every run. The Rounds field is the cost factor, 4 to 12 in the form, with a default of 10. Each extra round doubles the work. The output is a 60-character string beginning with $2a$, then the two-digit cost, then a 22-character salt and the hash. Bcrypt only uses the first 72 bytes of input. Hashing runs in your browser, and there is no verify or compare feature.
How to use Bcrypt Generator
- Complete the available fields: Password / text, Rounds. Use the field labels and examples shown in the workspace.
- Select “Generate” and check the result before copying or downloading it.
Worked example
Hashing secret123 at cost 10 gives a string like $2a$10$ followed by 53 more characters, 60 in total. The exact characters change on every run because the salt is random, so two hashes of the same password never look the same. Both still verify correctly against secret123 in any standard bcrypt library.
Tips for a better result
- Use the same cost your application uses, often 10 to 12. Higher costs freeze this page briefly, because hashing runs synchronously.
- Most libraries accept the $2a$ prefix. If yours expects $2y$, as some PHP setups do, check its documentation before editing the prefix.
- Avoid typing a real user's password here. Seed a temporary password and require the user to change it on first login.
Frequently asked questions
Why is the hash different each time?
Bcrypt embeds a fresh random salt in every hash. That is intentional, so identical passwords do not produce identical hashes. Verification reads the salt back out of the stored string.
Can I check a password against an existing hash here?
No. This tool only creates hashes. To verify, use your application's bcrypt compare function, which re-hashes the password with the stored salt and cost.
Is there a length limit on the password?
Yes. Bcrypt only processes the first 72 bytes, so anything beyond that is ignored. Non-English characters can take several bytes each, which reaches the limit sooner.
What to check
Local checks are not a security audit or live malware scan. Do not enter active passwords, API keys or other secrets.
Read the Privacy Policy for information about local processing, connected services and advertising.