htpasswd Generator
Generate Apache htpasswd entries in bcrypt, apr1 (MD5) or SHA-1 format, hashing passwords locally — handy for Nginx and Basic Auth setups.
>_ USAGE GUIDE
Generate Apache htpasswd entries locally in bcrypt, apr1 (MD5) or SHA-1 format. Enter a username and password, choose the format, and you get a single username:hash line ready to append to a .htpasswd file for Basic Auth. Passwords are hashed entirely on your machine and never uploaded.
Each format trades off differently. bcrypt is the strongest, salted with a tunable cost, and is the recommended default. apr1 is Apache's legacy MD5-crypt with the broadest compatibility, good for older Apache setups. SHA-1 is weakened and only for environments that still require it. A .htpasswd file holds one username:hash line per user, so add multiple users by appending lines. Nginx Basic Auth reads the same .htpasswd format, so one generated file serves both servers.
- Enter username and password: fill in the account and its password
- Choose the hash format: pick bcrypt, apr1 or SHA-1
- Generate the entry: get a single
username:hashline - Copy it in: paste it into
.htpasswdand save
>_ FAQ
Q1 · Which of the three formats should I choose?
For anything new, prefer bcrypt: it is salted, resists rainbow tables and its cost parameter can slow brute force. Use apr1 when you must stay compatible with an older Apache or an existing toolchain. SHA-1 is no longer recommended and only for cases that force it. Default to bcrypt.
Q2 · How do I put the entry into a .htpasswd file?
Append the whole username:hash line to the end of .htpasswd, one user per line with no stray spaces inside a line. In Apache, point AuthUserFile at the file and enable AuthType Basic with Require valid-user. To add a user, append another line rather than overwriting existing ones.
Q3 · Why does Nginx accept htpasswd output too?
Nginx's auth_basic_user_file reads the same format as Apache's .htpasswd, so one file works on both servers. As long as the hash format is one Nginx supports (such as bcrypt or apr1), place the generated entry in .htpasswd and reference it from the Nginx config.
Q4 · Is my password uploaded anywhere?
No. The password is hashed only in your browser and never sent to a server; closing the page leaves nothing behind. The hash itself is safe to store in .htpasswd because it is not reversible, but it is still wise to work in a controlled setting so the password is not seen by others.
Q5 · How does it differ from the MD5 and HMAC tools?
Those two are general-purpose: MD5 produces a bare digest (no longer fit for storing passwords) and HMAC produces a keyed signature. This tool produces a htpasswd-specific file line, joining the username, separator and web-server-ready hash into one line you can feed straight to Apache or Nginx, rather than a bare hash value.