Htpasswd Generator
Passwords are hashed in your browser and never sent anywhere.
Keep the .htpasswd file outside the public web folder when you can, so nobody can download it.
Htpasswd Generator
HTTP Basic Authentication is the quickest way to put a password on a staging site, an admin folder or a private page: the browser asks for a user name and password before anything loads. The passwords live in a .htpasswd file as hashes, not as plain text. This generator creates those lines for one or more users with bcrypt (the strongest option Apache supports), APR1-MD5 (works on both Apache and Nginx) or legacy SHA-1, and gives you the matching Apache .htaccess and Nginx configuration. The hashing runs in your browser, so the passwords are never sent to us.
How to use Htpasswd Generator
- Enter a user name and a password, or click Generate for a strong random password. Add more users if you need them.
- Choose the hash: bcrypt for Apache, APR1-MD5 if the site runs on Nginx.
- Click Create .htpasswd, then download the file or copy its lines.
- Upload the file to the server (ideally outside the public folder) and add the Apache or Nginx snippet, with the file's full path.
When it comes in handy
- Hiding a staging or development site from visitors and search engines.
- Adding a second password in front of /wp-admin or a control panel.
- Protecting a folder of private downloads.
Frequently asked questions
Which hash should I choose?
Is Basic Auth secure?
Can I add more users later?
Are my passwords sent anywhere?
Related guides
-
How to Create a Genuinely Strong Password (And What Sites Do With It)
What actually makes a password hard to crack, why length beats complexity, and how sites store passwords safely using hashing.
-
What Is a UUID? Versions, Uniqueness and When to Use One
What UUIDs are, how version 4 and version 7 differ, how unique they really are, and the trade-offs of using them as database keys.
-
How to Check MX Records (and Fix Email That Isn't Arriving)
See any domain's MX records in seconds, online or with nslookup and dig, learn to read the priority numbers, and work through the checks that find out why email is not arriving.