Free Htaccess Password Generator

Protecting a staging site or private directory with Apache? You need a .htpasswd file — and passwords in it must be hashed, not plaintext. The Htaccess Password Generator creates bcrypt-hashed username:hash lines ready to drop into .htpasswd, plus the .htaccess snippet to enforce them. Generate, copy, deploy.

Private by design. This tool runs 100% in your browser — usernames and passwords are hashed locally and never uploaded or stored anywhere.

How to Use the Htaccess Password Generator

  1. Enter a username and a strong password.
  2. Click Generate to create the user:$2y$… line.
  3. Copy or download the line into your .htpasswd file (outside the web root).
  4. Point Apache at it with AuthUserFile in your .htaccess — see the snippet below.

Features

Bcrypt-hashed entries; username validation; cost selection; .htaccess snippet included; copy and download.

Benefits & Use Cases

Lock down staging environments, protect private downloads, gate admin panels on shared hosting, or add a quick auth layer to any Apache directory.

Tips

Store .htpasswd outside the web root so it's never downloadable. Always serve password-protected areas over HTTPS, and use strong unique passwords even behind basic auth.

Frequently Asked Questions

What is a .htpasswd file?

It is Apache's password file for HTTP basic authentication. Each line holds a username and hashed password; Apache checks credentials against it before serving protected content.

Why bcrypt instead of MD5?

Apache's old MD5 format is fast to crack. Bcrypt with cost 10+ resists brute force, and modern Apache versions support it via the $2y$ prefix this tool generates.

Where do I put the .htpasswd file?

Anywhere outside your public web directory, then reference the full path with AuthUserFile in .htaccess. Never place it where browsers can download it.

Can I add multiple users?

Yes — generate one line per user and append each to the same .htpasswd file, one per line.

Is basic auth secure?

With bcrypt hashes, HTTPS, and strong passwords, it is reasonable for low-risk areas. For sensitive apps, prefer full application-level authentication with sessions and 2FA.

Related Tools