
Loading…
Developer tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
Each step doubles the work. 10 is a good default.
Press Generate line.
AuthType Basic AuthName "Restricted area" AuthUserFile /path/to/.htpasswd Require valid-user
auth_basic "Restricted area"; auth_basic_user_file /etc/nginx/.htpasswd;
Everything is hashed in your browser. The password is never sent anywhere. Add one line per user to the file.
Need htpasswd Generator built into your own product? We build it as a full app, API and admin included. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The htpasswd generator stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Skip the build: ready-made apps with the code included. Buy once, own the source, and try each one live first.


Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demoHTTP Basic authentication asks the visitor for a username and password before the server shows a page. The server checks them against a file, usually named .htpasswd, with one line per user in the form username:hash. This tool builds that line.
Save the file outside your public web root, then add this to the .htaccess of the folder you want to lock, or to the virtual host:
AuthType Basic
AuthName "Restricted area"
AuthUserFile /path/to/.htpasswd
Require valid-user
Add auth_basic "Restricted area"; and auth_basic_user_file /etc/nginx/.htpasswd; inside the server or location block, then reload nginx.
Basic auth sends the password with every request, so serve the site over HTTPS only. Use long, unique passwords, keep the file out of git, and remember that it hides a page rather than protecting a real application. For anything with real user accounts, build proper sign-in.
bcrypt. It is slow on purpose, salted and supported by current Apache and nginx. APR1-MD5 is the old Apache default and still works everywhere. SHA1 has no salt and is only for legacy cases.
Apache expects the $2y$ prefix. It is the same algorithm as $2a$ or $2b$, only the label differs, so the tool writes the label Apache reads.
Yes. nginx reads bcrypt, APR1-MD5 and SHA1 entries in the same file format. Point auth_basic_user_file at the file.
Generate another line and add it on a new row of the same file. Each line is one user.
No. Hashing runs in your browser and nothing is uploaded or logged.