htpasswd file generator
Generate htpasswd file entries for Apache basic authentication. Supports bcrypt, MD5 and SHA-1 hash algorithms.
- Free, no sign-up
- No data stored
- Reviewed 2026-01-15
Your details
Results
About the htpasswd Generator
Generate username:password hash entries for Apache .htpasswd files. Choose bcrypt (recommended), Apache MD5 (apr1) or SHA-1. Add multiple users and optionally generate a .htaccess realm directive.
How to use the htpasswd Generator
- Enter username and password pairs.
- Select the hash algorithm.
- Set bcrypt cost if applicable.
- Optionally generate the .htaccess auth directive.
- Copy the htpasswd entries.
Frequently asked questions
Which algorithm is most secure?
Bcrypt (prefix $2y$). Apache MD5 ($apr1$) is acceptable. Plain SHA-1 ({SHA}) is weak and should be avoided.
Where do I put the .htpasswd file?
Outside the web root for security (e.g. /etc/apache2/.htpasswd). Reference it in .htaccess with AuthUserFile.
Does this work with nginx?
nginx supports Apache-style htpasswd files with bcrypt and MD5. Use auth_basic_user_file directive.