.htpasswd bcrypt Generator
Build the .htpasswd line with a real bcrypt hash ($2y$ prefix), the scheme Apache recommends. You pick the cost and everything is computed in your browser.
Real bcrypt, computed in your browser — nothing is sent to a server. The salt is drawn fresh on every click, so the same password produces a different hash each time. That is expected.
—
The .htpasswd line, with bcrypt computed in your browser
.htpasswd is the file holding the usernames and passwords for basic authentication in Apache and nginx. Each line carries the username, a colon and the password hash — the password itself never appears. Among the schemes Apache accepts, bcrypt is the recommended one: it was designed to be slow on purpose, which makes brute forcing expensive even with dedicated hardware.
Enter the username, the password and the cost, and the page returns the finished line. Cost is the work factor: each extra point doubles the computation time. Cost 10 takes a few tenths of a second, cost 14 already runs past a second — and that slowness is what protects the file if it ever leaks. The measured time appears under the result, which helps you choose: the rule of thumb is to raise the cost until the calculation takes somewhere between 200 and 500 milliseconds on the server where the login will run.
The whole calculation happens in your browser, so the password never travels anywhere. The 16-byte salt is drawn fresh on every click, which is why the same password produces a different line each time — and that is exactly right: the salt is what stops two accounts with the same password from sharing a hash. Any of the generated lines will authenticate normally.
Frequently asked questions
Which cost should I use?
Why does the hash change every time I click?
Is the $2y$ prefix different from $2a$ or $2b$?
Related Tools
.htpasswd Generator
Generate .htpasswd lines for Apache/Nginx basic auth. Supports MD5 (apr1), SHA1 and bcrypt hashes. Paste the result straight into the file. Everything in your browser.
.htaccess Generator
Generate Apache .htaccess snippets: force HTTPS, redirect www, expire cache, GZIP compress, block IPs.
Regex Cheatsheet
Quick reference of the main regular expressions — quantifiers, classes, anchors, groups, lookarounds, flags. With clickable examples and explanations. Everything in your browser.
Shell Argument Escaper
Quote a string safely for bash/sh, wrapping in single quotes and handling embedded quotes.
Cron Parser (describe expression)
Paste a cron expression and see in plain text when it will fire (e.g. "every day at 9am" for `0 9 * * *`). Lists the next N runs. Everything in your browser.
docker-compose MySQL Generator
Generates a ready-to-use docker-compose for MySQL, with the root password, port 3306 published and a persistent volume. Pick the image tag and start the database.