🔐 .htpasswd Generator

Secure · Client-side · Apache & Nginx Basic Auth
🛡️ All hashing done locally — zero upload
Strong
bcrypt: strongest, default for modern Apache/Nginx
📄 Generated Line Copy to .htpasswd
admin:$2y$10$...
📂 Configuration Example

Apache (.htaccess):

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /path/to/.htpasswd
Require valid-user

Nginx:

location / {
    auth_basic "Restricted Area";
    auth_basic_user_file /etc/nginx/.htpasswd;
}

⚠️ Store .htpasswd outside web root!

✓ bcrypt cost factor: 10 · APR1 compatible with Apache · SHA for Nginx

📘 What is .htpasswd?

.htpasswd is a flat-file used to store usernames and passwords for basic HTTP authentication. This tool generates entries in the correct format using secure algorithms like bcrypt, APR1, and SHA.

❓ Frequently Asked Questions

Is this generator safe to use?

Absolutely. All hashing is performed locally in your browser using JavaScript. Your password never leaves your device.

Which algorithm should I choose?

bcrypt is the most secure and recommended for modern systems. APR1 (MD5) is for legacy Apache compatibility. SHA algorithms are often used with Nginx.

How do I use the generated string?

Copy the line and append it to your .htpasswd file. Each line represents one user. Use the "Download" button to get a ready-to-use file.

Where should I place the .htpasswd file?

For security, store it outside your website's document root (e.g., /etc/nginx/.htpasswd or /home/user/.htpasswd).

Can I use this for Nginx?

Yes! Nginx supports apr1, bcrypt (with auth_basic), and SHA algorithms. Select the appropriate one for your server.

What does the password strength bar mean?

It evaluates length, character variety, and complexity to encourage strong passwords.