Free.htpasswd Generator
Create password entries for Apache.htpasswd files used in HTTP Basic Authentication. Supports bcrypt (the modern default), Apache MD5 (apr1) and plain-text formats so you can protect directories and admin areas.
An htpasswd file holds hashed credentials — the bcrypt Generator produces the same kind of digest. Pair it with the Basic Auth Generator when you are wiring up an Authorization header.
How to use the Htpasswd
- 1 Enter the username for the account you are protecting.
- 2 Enter the password you want that account to use.
- 3 Choose the hash format — bcrypt is the strongest of the options Apache supports.
- 4 Copy the resulting username:hash line into your .htpasswd file.
HTTP Basic Authentication credentials for Apache and Nginx
The htpasswd Generator constructs entry lines for `.htpasswd` authentication files utilized by Apache HTTP Server and Nginx web servers to enforce HTTP Basic Authentication. Each entry combines a username and a securely hashed password separated by a colon (e.g., `username:$2y$10$...`).
The generator supports modern, secure bcrypt hashing (the recommended standard for Apache 2.4 and modern Nginx), as well as legacy Apache MD5 (apr1) and crypt algorithms for older hosting environments. Deploying strong hashes in `.htpasswd` files protects administrative dashboards and staging sites from brute-force access attempts.
- Generates copy-ready `.htpasswd` credential lines for Apache and Nginx web servers.
- Supports modern, brute-force-resistant bcrypt password hashing.
- Provides legacy Apache MD5 (apr1) and crypt hashing for older server architectures.
- Essential for restricting access to staging websites, admin directories, and internal APIs.
Protecting a directory
Create a.htpasswd file outside your web root and reference it from a.htaccess file with AuthUserFile, AuthType Basic and Require valid-user. The browser then prompts for credentials before serving the protected content.
Frequently asked questions
What is a .htpasswd file for?
It stores usernames and hashed passwords for HTTP Basic authentication, which Apache and Nginx can require before serving a directory. Each line is a username, a colon, and the hashed password — never the password itself.
Which hash format should I choose?
bcrypt, unless your server is old. It is salted and deliberately slow, so a stolen .htpasswd file is expensive to crack. The older crypt and SHA1 variants are faster to verify but also far faster to attack, and plain-text entries should never be used.
Is Basic authentication secure?
Only over HTTPS. Basic auth sends the credentials Base64-encoded, which is encoding rather than encryption, so anyone able to read the traffic can decode them instantly. Without TLS it offers no protection at all.
Related Security & Cryptography Tools
You might also need
Tools from other categories that people pair with the Htpasswd: