htpasswd
What is htpasswd?
htpasswd is a file format used by Apache and Nginx to store username-password pairs for HTTP Basic Authentication. Each line contains a username and a hashed password separated by a colon, e.g., user:$2y$05$....
Supported algorithms
bcrypt- the recommended algorithm, uses adaptive cost factor for brute-force resistanceSHA-256/SHA-512- Linux crypt-style hashes with random saltsMD5 (apr1)- Apache-specific MD5 variant, widely compatible but less secureSSHA- salted SHA-1, used in LDAP-style configurations
How to use this tool
- Enter a username and password (or generate a random one)
- Select a hashing algorithm -
bcryptis recommended for new setups - Copy the generated
.htpasswdline or download the file
Common use cases
- Protecting staging environments or admin panels with Basic Auth on Apache or Nginx
- Generating password entries for
.htpasswdfiles without CLI access - Creating credentials for Docker registry authentication
- Setting up Basic Auth on reverse proxies like Traefik or Caddy