← ← All Tools

🔐 htpasswd Generator

Generate local htpasswd lines for Apache/Nginx Basic Auth with bcrypt, apr1, and SHA-1 output

This tool defaults to bcrypt and generates `.htpasswd` entries locally in your browser. Usernames cannot contain `:` and your password is not uploaded by the tool.

Leading and trailing spaces are trimmed automatically. `:` and line breaks are rejected because `.htpasswd` uses `username:hash` lines.

Password Strength

Empty

Algorithm

Bcrypt is slower but safer and should be your default for new `.htpasswd` files.

Higher cost means slower hashing. In-browser, 8-12 is a good default range; increase only when you really need it.

Compatibility Notes

  • Bcrypt: recommended for modern Apache / Nginx Basic Auth setups.
  • Apache MD5 (apr1): retained for older Apache compatibility and still salted.
  • SHA-1: compatibility-only and not recommended for new passwords.

FAQ

Why do repeated generations create different hashes?

Bcrypt and Apache MD5 (apr1) both add a random salt automatically, so the same password produces a different hash each time while still verifying correctly in Basic Auth.

Which algorithm should I choose?

Prefer bcrypt for new setups. Switch to Apache MD5 or SHA-1 only when an older environment explicitly requires `$apr1$` or `{SHA}` output.

Does this tool upload my username or password?

No. All hashing happens locally in your browser and the page does not send your username or password to a server.

Free online htpasswd generator for Apache and Nginx Basic Auth files. Generate local `.htpasswd` entries in bcrypt, Apache MD5 (apr1), or SHA-1 format with password confirmation, strength hints, copy, and download. Everything runs locally in your browser with no credential upload.