Generate Apache .htpasswd entries using bcrypt, MD5-APR1, SHA-1, or plaintext algorithms. Secure your web directories with HTTP Basic Authentication.
Hashed entries will appear here
Ready to paste into .htpasswd
The htpasswd Generator creates password entries compatible with Apache's .htpasswd file format, which controls HTTP Basic Authentication for protected web directories and reverse-proxy endpoints. Choose from four supported hashing schemes — bcrypt (the most secure, recommended for all new deployments), MD5-APR1 (widely compatible with older Apache versions), SHA-1 (legacy, avoid for new sites), or plaintext (for testing only) — and receive a ready-to-paste line in `username:hash` format. All hashing is performed client-side using the Web Crypto API and a pure-JavaScript bcrypt implementation, so passwords are never transmitted over the network.
QWhich hashing algorithm should I use for .htpasswd?
Use bcrypt ($2y$) for all new deployments. It is the only scheme that is computationally expensive enough to resist brute-force attacks. MD5-APR1 is still widely supported but is susceptible to fast GPU cracking. SHA-1 and plaintext should be avoided entirely in production.
QWhat bcrypt work factor should I choose?
A work factor (cost) of 10 or 12 is recommended for most web applications. Each increment doubles the computation time. Higher values provide more resistance to cracking but increase login latency. Test on your target server — a factor that causes >0.5 s of latency per login may degrade user experience.
QHow do I add the generated line to my .htpasswd file?
Copy the `username:hash` output and append it to your .htpasswd file — one entry per line. If the file does not exist yet, create it and paste the line. Apache will pick up the changes immediately without requiring a restart.
QCan I use this output with Nginx?
Yes. Nginx's ngx_http_auth_basic_module reads standard .htpasswd files. Bcrypt entries require Nginx compiled with the optional CRYPT support (`--with-http_auth_basic_module` and a CRYPT library). MD5-APR1 is always supported by Nginx's bundled implementation.
QIs it safe to generate production passwords in a browser?
Yes, because this tool performs all operations locally using JavaScript crypto libraries. No data is sent to any server. For maximum safety, use the tool in an offline browser session or behind a VPN when entering real production passwords.