.htpasswd Generator
Generate .htpasswd entries for Apache HTTP authentication. All hashing is done in your browser.
About .htpasswd
The .htpasswd file is used by Apache web server for basic HTTP authentication. Each line contains a username and password hash separated by a colon. The SHA-1 algorithm uses the {SHA} prefix with a Base64-encoded SHA-1 hash. The Apache MD5 algorithm uses the $apr1$ prefix.
How to Use
- 1Enter a username and password.
- 2Select the hashing algorithm (bcrypt is recommended).
- 3Click Generate to produce the htpasswd entry.
- 4Copy the entry and add it to your .htpasswd file on the server.
Frequently Asked Questions
What is an .htpasswd file?
An .htpasswd file stores usernames and hashed passwords for Apache HTTP Basic Authentication. It is placed on the server and referenced by .htaccess or Apache configuration to protect directories or files with password prompts.
Which algorithm should I use for htpasswd?
Bcrypt is the strongest option and is recommended for new installations. MD5 (apr1) is widely supported and a good fallback. SHA-1 and crypt are older and less secure but may be needed for compatibility.
Is my password sent to a server?
No. All hashing is done locally in your browser. Your password never leaves your device and is not stored or logged anywhere.