World’s largest virtual agentic engineering & quality conference
Generate secure .htpasswd entries online for Apache and Nginx basic authentication. Enter a username and password, choose bcrypt, MD5, SHA-1, or crypt, and copy the ready-to-use line, right in your browser.
Enter the username you would like to add to your .htpasswd file.
Enter the password to be encrypted.
Generate
Reset
The htpasswd generator is a free online tool that produces the credential lines stored inside a .htpasswd file. A .htpasswd file holds username and hashed-password pairs, one per line, in the format username:hash. Web servers such as Apache and Nginx read this file to gate a directory behind HTTP basic authentication, prompting visitors for a valid username and password.
Instead of running command-line utilities, you type a username and password, choose a hash algorithm, and the tool outputs a single line such as username:$2y$10$... that you paste straight into your .htpasswd file. The hashing runs locally in your browser, so the plain-text password is never uploaded. Bcrypt is the recommended hash because it is salted and deliberately slow, which makes stored credentials hard to crack.
Creating a .htpasswd entry takes only a few seconds, and you do not need to install Apache utilities or run any commands. Follow these steps:
The htpasswd format supports several password hashes, and the right one depends on your server version and security needs. The table below compares the common options so you can pick with confidence:
| Algorithm | Security | Best for |
|---|---|---|
| bcrypt | Strong, salted, and deliberately slow against brute force | New .htpasswd files and the recommended default |
| MD5 (APR1) | Moderate, salted Apache-specific MD5 variant | Portable files needing broad server compatibility |
| SHA-1 | Weak, unsalted, and considered outdated today | Legacy systems that cannot use bcrypt |
| crypt | Very weak, truncates the password to eight characters | Old Unix setups only; avoid for new work |
As a tool, the htpasswd generator offers a few capabilities that make creating protected directories effortless. Here are the features of our generator:
A .htpasswd file is useful anywhere you need a quick layer of access control without a full login system. The generator speeds up each of these workflows by producing the credential line for you:
This generator is maintained by TestMu AI (formerly LambdaTest), the team behind a unified testing platform, so it is shaped by the same focus on secure, reliable web infrastructure that QA and DevOps engineers depend on. All processing happens in your browser, and no data is uploaded.
A .htpasswd file is a plain-text file that stores username and hashed-password pairs, one per line, in the format username:hash. Web servers like Apache and Nginx read this file to protect directories with HTTP basic authentication, prompting visitors for valid credentials.
Use bcrypt whenever your server supports it. Bcrypt is deliberately slow and salted, which makes it the most resistant to brute-force attacks. MD5 (APR1) is a portable fallback, while SHA-1 and crypt are older and weaker, so avoid them for new files.
Paste the generated line into a .htpasswd file, then add an AuthType Basic, AuthName, and AuthUserFile directive pointing to that file in your .htaccess or virtual host. Add Require valid-user to force authentication, then reload Apache to apply the change.
Nginx reads the same .htpasswd format. Inside a location or server block add auth_basic with a realm name and auth_basic_user_file pointing to your .htpasswd file. Reload Nginx, and the protected path will prompt visitors for the username and password you generated.
No. All hashing happens locally in your browser using JavaScript, so your password is never uploaded or transmitted. The generated line is produced on your own device, which makes the tool safe to use for real credentials and internal infrastructure.
Yes, the htpasswd generator is completely free with no signup, login, or usage limit. Generate as many username and password lines as you need. The tool is maintained by TestMu AI (formerly LambdaTest) and runs entirely in your browser.
Generate a separate username:hash line for each user and place each line on its own row in the same .htpasswd file. Usernames must be unique. The server checks every line, so any user listed in the file can authenticate against the protected directory.
A .htpasswd file stores the username and hashed-password pairs. A .htaccess file holds Apache configuration directives, including the AuthUserFile line that points to your .htpasswd. In short, .htaccess turns on authentication and .htpasswd supplies the credentials it checks.
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance