We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Generate user authentication password files for Apache and other servers. Supports multiple encryption algorithms including BCrypt, MD5, and SHA-1.
Enter username and password to generate
When you need to set up access permissions for a website directory but struggle with the complex and error-prone format of manual password records, this tool can quickly generate standard .htpasswd file entries. The .htpasswd file is a text file used by the Apache HTTP Server to store usernames and encrypted passwords for HTTP Basic Authentication. Based on your input username, password, and selected encryption algorithm (such as BCrypt, MD5 APR1, or SHA-1), this tool generates a compliant single-line record in real time. You simply need to copy it into the .htpasswd file on your server.
Q: How do I add the generated content to my .htpasswd file?
A: Simply append the generated "username:encrypted_password" string as a new line to the .htpasswd file on your server. Each user should have their own line.
Q: What encryption methods does htpasswd support?
A: It supports BCrypt (most secure), MD5 APR1 (common for Apache), SHA-1 (compatible with legacy systems), and Plain Text (not recommended). BCrypt is currently the best choice against brute-force attacks.
Do not use the "Plain Text" algorithm in a production environment, as it does not encrypt the password, leaving it fully visible. The generated .htpasswd file should be placed outside your web directory and correctly referenced using Apache's AuthUserFile directive. Please note that this tool generates only one record at a time. To manage multiple users, you need to generate them one by one and merge them into the same file.
For production environments, it is strongly recommended to use the BCrypt algorithm. It provides the strongest password storage security through an adaptive hash function and salt. A typical .htpasswd file content example is as follows, where each line represents a user:admin:$apr1$r5... (MD5 APR1 Hash)
user2:$2y$10$... (BCrypt Hash)
legacyuser:{SHA}... (SHA-1 Hash)
When configuring Apache, ensure that the AuthUserFile path in your .htaccess file points to the correct absolute path of the .htpasswd file, and set appropriate file permissions (e.g., 644).