.htpasswd Generator

Generate an Apache or Nginx basic auth line with APR1 MD5 or SHA-1, ready to paste into your .htpasswd file.

Hash scheme

Apache's own salted MD5. The default for htpasswd and the safest of the two options here. Works in Apache and in Nginx.

Username
Password
Salt

Hashing happens in this tab. The password is never sent anywhere and never leaves your machine.

.htpasswd

Enter a password

Add this line to your .htpasswd file, one user per line, then point auth_basic_user_file or AuthUserFile at it.

How to Create an .htpasswd File

1

Choose a scheme

APR1 is Apache's salted MD5 and is what the htpasswd command produces by default. It works in Nginx too. Pick SHA-1 only if something in your stack demands it.

2

Enter the username and password

The salt is generated for you and can be regenerated at any time. The same password with a different salt produces a different hash, which is the point of a salt.

3

Add the line to your file

Paste it into .htpasswd, one user per line, then point AuthUserFile in Apache or auth_basic_user_file in Nginx at that file and reload.

Features

APR1 MD5, the default htpasswd scheme
SHA-1 for legacy configurations
Output matches openssl passwd -apr1 exactly
Random salt, regenerated on demand
Works with both Apache and Nginx
Full UTF-8 support, so Turkish passwords hash correctly
The password never leaves your browser
Free, no sign-up needed

Frequently Asked Questions

Outside the web root, always. If it sits in a public directory, someone can download your password hashes. A path like /etc/nginx/.htpasswd or /var/www/private/.htpasswd is fine as long as the web server user can read it.

Inside a location block, add auth_basic with a realm name and auth_basic_user_file with the path to the file, then reload Nginx. Nginx reads APR1 hashes without any extra module.

Set AuthType Basic, AuthName, AuthUserFile and Require valid-user, either in the vhost or in an .htaccess file. If you use .htaccess, the directory needs AllowOverride AuthConfig.

By modern password hashing standards, no. It is salted MD5 with a thousand iterations, which a GPU chews through. It is fine for keeping a staging site or an internal dashboard behind a door, and it is not what you should use to store your users' passwords. Use bcrypt or Argon2 for that.

Because the salt changes. That is deliberate: it means two users with the same password get different hashes, so nobody can spot the match by looking at the file. Any of the generated lines works for the same password.

No. Basic auth sends the username and password Base64 encoded on every request, which is not encryption. Over plain HTTP anyone on the network reads them. Put it behind HTTPS.

Apache supports bcrypt with htpasswd -B, but generating it in a browser would mean a slow JavaScript implementation of a deliberately slow algorithm. For bcrypt, run htpasswd -B on the server itself.

No. The MD5 and SHA-1 implementations run in this tab. Nothing you type is uploaded, stored or logged.

Need a Custom Tool or Application?

We build production-grade web applications, SaaS platforms, and developer tools. Let's talk about your project.

or book a free call