htpasswd Generator

Create Apache .htpasswd entries for HTTP Basic Authentication

SHA-1 / MD5 Apache Ready Client-Side
Note: For production use with bcrypt, use the command-line htpasswd tool.

How to Use .htpasswd

  1. Generate your htpasswd entry above
  2. Create a file named .htpasswd on your server (outside the web root)
  3. Paste the generated line into the file
  4. Add these lines to your .htaccess:
    AuthType Basic
    AuthName "Restricted Area"
    AuthUserFile /path/to/.htpasswd
    Require valid-user

FAQ

.htpasswd is a flat-file used by Apache for HTTP Basic Authentication. Each line contains a username:hash pair. Combined with .htaccess directives, it restricts access to web directories.

HTTP Basic Authentication transmits credentials in Base64 (not encrypted) unless used with HTTPS. Always combine .htpasswd with SSL/TLS. For strong password hashing, use bcrypt via the server-side htpasswd command-line tool.