htpasswd Generator
Create a line for an htpasswd file from a username and password, using the {SHA} format that Apache supports. The password is hashed in your browser and is not sent anywhere.
1 Fill in the boxes
2 Your answer
Your answer shows here as you type.
How to use the htpasswd Generator
- Enter the username. It cannot contain a colon.
- Enter the password you want to store.
- Copy the line and add it to your .htpasswd file.
Frequently asked questions
What is an htpasswd file?
It is a plain text file with one username:hashed-password line per user. Apache HTTP Server reads it for basic authentication when it is set with AuthUserFile, and other servers accept similar files.
What does the {SHA} prefix mean?
It marks a password hash made with SHA-1 and encoded in base64, the format that htpasswd -s writes. SHA-1 is fast to compute, so it is weaker than bcrypt.
Is bcrypt a better choice?
Yes. Apache htpasswd -B writes bcrypt hashes that start with $2y$, which are slow to crack. Use that option when you can run htpasswd on your server.
Where should the htpasswd file be stored?
Keep it outside the public web root so visitors cannot download it. Point the server config at its full path.
Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.