Htpasswd Generator

Create a ready to paste .htpasswd entry, hashed with SHA-1 inside your browser.

Create an htpasswd entry

Username: —
Digest: —
Bcrypt and APRs MD5 lines cannot be produced in a browser: bcrypt needs a server side tool such as htpasswd -B on the command line.

How to use the Htpasswd Generator

  1. Enter the username and password you want to protect the site with.
  2. Choose the SHA-1 line or the plain text line format.
  3. Click Generate line and copy the result into your .htpasswd file.

Features

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