Htpasswd Generator
Create a ready to paste .htpasswd entry, hashed with SHA-1 inside your browser.
Create an htpasswd entry
Username: —
Digest: —
How to use the Htpasswd Generator
- Enter the username and password you want to protect the site with.
- Choose the SHA-1 line or the plain text line format.
- Click Generate line and copy the result into your .htpasswd file.
Features
- SHA-1 hashing through the Web Crypto API
- Ready to paste username colon hash lines
- Plain text mode for quick local tests
- Clear note that bcrypt needs a server side tool
Advertisement
Frequently Asked Questions
Common questions about the free online htpasswd generator.
Type a username and password, click Generate line, then paste the result into a file named
.htpasswd on your web server.
It produces a SHA-1 line in the form username colon {SHA} followed by base64, which Apache
and nginx both accept.
No. Browsers have no bcrypt function, so use htpasswd -B on the server command line or a
server side script for bcrypt.
Point AuthUserFile at the absolute path of the .htpasswd file and set AuthType Basic with a
Require valid-user line.
Run a command such as htpasswd -c /etc/apache2/.htpasswd username on the server, or paste the
generated line into a new file.
Yes. Generate one line per user and put each line on its own row in the same .htpasswd file.
It is weaker than bcrypt. Always serve basic auth over HTTPS, and prefer bcrypt where your
server can generate it.
No. The hash is computed with the Web Crypto API in your browser, so your password never
leaves your device.
The text before the first colon is the login name. Characters that would break the line, such
as a colon, are removed.
Yes. The generator is fully responsive, and the line can be copied and pasted into a terminal
or control panel.
Last updated: October 10, 2026