MyVIPWebTools logo

.htpasswd Generator — Create Apache Basic Authentication Credentials

Our .htpasswd Generator creates a single username:hash line in the format Apache's htpasswd command-line tool produces, ready to paste into your .htpasswd file for HTTP Basic Authentication. Choose between the {SHA} format (SHA-1, computed with the browser's native Web Crypto API) or APR1-MD5 (Apache's salted, iterated MD5 variant, matching the output of `htpasswd -m`). Enter a username and password, pick a format, and the credential line updates instantly. Nothing is sent to a server — the entire hash computation happens in your browser.

Hash format

Enter a username and password to generate a .htpasswd line

How to Use the .htpasswd Generator — Free Apache Basic Auth Password Tool

  1. 1

    Enter the username you want to authenticate with (colons are not allowed in usernames since they're the field separator).

  2. 2

    Enter the password for that user.

  3. 3

    Choose a hash format: '{SHA}' (SHA-1, simple and fast) or APR1-MD5 (salted and iterated, matches `htpasswd -m`).

  4. 4

    Copy the resulting username:hash line and paste it as a new line into your server's .htpasswd file.

Why Use .htpasswd Generator — Free Apache Basic Auth Password Tool?

Apache's mod_authn_file Basic Authentication reads credentials from a .htpasswd file where each line has the format username:hash. Rather than requiring a local install of Apache's htpasswd command-line utility, this tool computes the exact same hash formats directly in your browser. The {SHA} format is a simple unsalted SHA-1 digest prefixed with {SHA} and base64-encoded — fast to compute but, because it's unsalted, more vulnerable to precomputed rainbow-table attacks if the hash is ever exposed. APR1-MD5 (the format produced by `htpasswd -m`, prefixed with $apr1$) is Apache's own salted, 1000-iteration variant of MD5 crypt, adding a random salt per password and repeated hashing to slow down brute-force attempts significantly compared to a single unsalted hash. Note that Basic Authentication itself sends credentials in an easily-decoded (not encrypted) form over plain HTTP — always pair .htpasswd authentication with HTTPS so credentials aren't exposed in transit, regardless of which hash format protects the stored file.

Frequently Asked Questions

Related Tools

.htpasswd Generator — Free Apache Basic Auth Password Tool | MyVIPWebTools