Htpasswd Generator

Password-protect a folder or site with basic auth in a couple of minutes.

How to create an htpasswd file

  1. Add one username:password per line.
  2. Choose the encryption and file path.
  3. Download .htpasswd and copy the .htaccess or nginx config.

About Htpasswd Generator

Create .htpasswd files for Apache and nginx password protection.

It works in your browser for speed and privacy, remembers your settings on this device, and every result can be copied, downloaded or shared.

Good for

  • Protecting staging sites and admin areas
  • Private downloads and dashboards
  • Apache and nginx Basic Auth

Tip: Always serve Basic Auth over HTTPS — the password is sent with every request.

Frequently asked questions

Which encryption should I choose?

bcrypt ($2y$) — supported by Apache 2.4+ and nginx and much harder to crack. APR1-MD5 is for older servers; SHA-1 and plain text only for legacy systems.

How do I protect a folder with Apache?

Upload the .htpasswd file outside your web root, then add the .htaccess snippet shown (AuthType Basic … Require valid-user) to the folder.

Does it work with nginx?

Yes — use the auth_basic and auth_basic_user_file lines in your server or location block and reload nginx.

Can I check an existing line?

Yes — paste a line from your .htpasswd file and a password to see whether they match.

Are my passwords uploaded?

No. Hashes are created in your browser — passwords are never uploaded, logged or put in share links.

Related tools

← Back to all tools