.htpasswd Entry Generator

Generate a line ready to paste into an Apache .htpasswd file (identifiant:hash format, APR1-MD5 algorithm) to protect a directory with basic authentication. The password you enter is never sent to a server: the hash is computed entirely in your browser, with a random salt generated locally.

Example:

How it works

Apache's .htpasswd file stores, one line per user, a username followed by a colon and a hash of the password (never the plaintext password). This tool calculates that hash in APR1-MD5 format (the one historically generated by the htpasswd command), with a random 8-character salt different on each generation, then builds the username:hash line ready to be added to your .htpasswd file or to the equivalent directive of your Apache/Nginx configuration.

Where should I place this line?

Add it to the file referenced by the AuthUserFile directive in your Apache configuration (one line per user), then enable AuthType Basic and Require valid-user on the directory to protect. Nginx requires a compatible module (e.g. ngx_http_auth_basic_module) pointing to the same type of file.

Is APR1-MD5 still secure enough today?

APR1-MD5 remains the most universally supported historical format in .htpasswd tools, but it is weaker than modern algorithms like bcrypt. For authentication protecting sensitive data, prefer a more robust algorithm if your Apache/Nginx version supports it (bcrypt via htpasswd -B), and always combine basic authentication with HTTPS; otherwise credentials travel in plaintext on the network with every request.

Privacy: the entered password and the calculated hash stay 100% local — nothing is sent to a server, including the random salt generated for this entry.