.htpasswd Generator
Enter a username and password to generate a .htpasswd line using the SHA-1-based {SHA} format Apache's basic auth accepts.
Uses the {SHA}format (a SHA-1 digest, Base64-encoded), one of the formats Apache's mod_auth_basic still accepts. It's not the default apr1-MD5 format the real htpasswd CLI tool generates, that uses a proprietary iterative algorithm not worth reimplementing client-side, but it works the same way in practice: paste the line into your .htpasswd file as-is. Everything runs locally; your password never leaves your browser.
Frequently asked questions
Is this the same format the real htpasswd command-line tool generates by default?+
No, the default is usually apr1-MD5, a proprietary iterative algorithm. This uses the {SHA} format instead, a plain SHA-1 digest that's safely implementable in a browser without reimplementing Apache's custom crypt scheme. Apache's mod_auth_basic accepts both.
Is my password sent anywhere when I use this?+
No, hashing happens entirely in your browser using the Web Crypto API. Nothing is sent to a server.
Where does this line actually go?+
Into a .htpasswd file (commonly stored outside your web root for security), referenced by an AuthUserFile directive in your Apache config or .htaccess. Each line is one username:hash pair; add more lines for more users.