Htpasswd Generator
Htpasswd is a command-line tool used to create and update the flat-files used to store usernames and passwords for basic authentication of HTTP users in Apache web servers. This tool generates htpasswd entries compatible with Apache HTTP Server.
Generate Htpasswd Accounts
How to use?
Copy the generated username:hash lines or download .htpasswd. Each line contains one account and its hash, not the plain password. Store the file outside your web root.
Verify Htpasswd Entry
Htpasswd Entry Format
Htpasswd entries follow the format:
username:password_hash
Different algorithms have different hash formats:
- Bcrypt:
$2y$prefix - MD5:
$apr1$prefix - SHA-1:
{SHA}prefix - Crypt: No prefix (DES)
Security Information
Important notes about Htpasswd:
- Store .htpasswd files outside your web document root for security.
- Use Bcrypt algorithm for new installations - it's the most secure option.
- MD5 with Apache salt ($apr1$) is acceptable for legacy systems.
- Avoid SHA-1 and Crypt (DES) for new installations - they're less secure.
- This tool processes all data in your browser - no credentials are sent to our server.
- Regularly update passwords and use strong, unique passwords for each user.
Apache Configuration
To use .htpasswd file in Apache, add this to your .htaccess or virtual host configuration:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /path/to/.htpasswd
Require valid-user
Replace /path/to/.htpasswd with the actual path to your .htpasswd file.
About Htpasswd Generator
Create a single account or a batch of up to 100 accounts for Apache HTTP Basic Authentication. Each output line contains a username and its password hash.
The form starts with five rows, with usernames on the left and passwords on the right. Fill only the rows you need, add more as needed, then copy or download .htpasswd. Hashing and verification run in your browser without sending credentials to the server.
Key features
- Single or multiple accounts One form handles both single accounts and batches, starting with five paired input rows. Add or remove rows up to 100 accounts. Completely empty rows are ignored and duplicate usernames are rejected.
- Exact password handling Usernames and passwords have separate fields. Password colons and spaces are preserved exactly; usernames are trimmed. Password fields are masked until Show passwords is enabled.
- Shared algorithm and progress Apply bcrypt with cost 10, Apache MD5, SHA-1 or DES crypt to the whole batch. Bcrypt uses a separate random salt for each account, with progress shown during generation.
- Copy, download and verify Copy all generated username:hash lines or download .htpasswd. Paste one generated line into the verification panel to check its password.
How to use Htpasswd Generator
Generate a password file from one account or a list of accounts, then verify a generated entry.
- Enter the accounts Fill a username on the left and password on the right. Five rows are provided; leave unused rows empty or use Add account for more rows.
- Choose an algorithm Keep bcrypt for new entries. It accepts passwords up to 72 UTF-8 bytes; DES generation accepts up to 8 bytes. The selected algorithm applies to every account.
- Generate the entries Click Generate accounts. Correct any reported row error, then wait for the progress counter to finish.
- Export the password file Copy the output or click Download .htpasswd. Store the file outside the web document root and reference its filesystem path in AuthUserFile.
- Verify an individual account Paste one username:hash line into Verify Htpasswd Entry, enter its original password and click Verify Password.
Usage tips
- Store .htpasswd outside the public document root and restrict filesystem permissions.
- Serve Basic Auth only over HTTPS because credentials are merely Base64-encoded in transit.
- Prefer bcrypt where the deployed Apache version supports it; avoid cryptographically weak legacy schemes.
- Passwords are not trimmed. Choose Reset to clear the generation fields and result. Editing the inputs clears outdated output.