Free Online .htpasswd Generator

Generate password entries for Apache .htpasswd files. Enter a username and password to create SHA-1 hashed authentication entries.

1. Copy the generated line above.

2. Create or edit .htpasswd on your server.

3. Paste one entry per line.

4. Create .htaccess in the protected directory:

AuthType Basic\nAuthName "Restricted Area"\nAuthUserFile /full/path/to/.htpasswd\nRequire valid-user

What Is a .htpasswd File?

A .htpasswd file stores usernames and encrypted passwords for Apache HTTP Basic Authentication. Visitors must enter valid credentials to access protected directories.

How This Tool Works

This tool generates entries using SHA-1 hashing with Apache's {SHA} scheme. The password is hashed and Base64-encoded. For production use with sensitive data, consider the htpasswd command-line tool with bcrypt.

Setting Up Basic Authentication

You need .htpasswd (credentials) and .htaccess (directives). Place .htpasswd outside your web root for security. The .htaccess file references the full server path to .htpasswd.

Related Tools

Frequently Asked Questions

Is SHA-1 secure enough for .htpasswd?
SHA-1 provides basic security and is widely supported. For higher security, use bcrypt via the command-line htpasswd tool. SHA-1 is acceptable for non-critical directories.
Where should I place the .htpasswd file?
Outside your web-accessible root directory to prevent direct download. For example, if your site is at /var/www/html, place it at /var/www/.htpasswd.
Can I have multiple users?
Yes. Add one username:password line per user. You can also use Require user directives to limit access to specific users.
Does this work with Nginx?
Yes. Nginx supports Basic Authentication with auth_basic and auth_basic_user_file directives. The SHA-1 format is compatible.
Is my password sent to any server?
No. The SHA-1 hash is computed entirely in your browser using the Web Crypto API. Your credentials never leave your device.

More from TUDITOOLS

CyberCheckTools
Online security tools & privacy checkers
ConvertAnything
Unit conversion tools for everything
Easy Calculators
100+ free everyday calculators