Htpasswd Generator

在浏览器本地生成 Apache htpasswd 行(user:hash)。apr1 / {MD5} / {SHA} / bcrypt 均支持。

What Is htpasswd Password Generator?

The htpasswd password generator creates the lines needed for Apache Basic Authentication files, in the format “username:password-hash”. Everything is computed locally in your browser, with support for four algorithms: apr1 (Apache MD5, compatible with htpasswd -m output), {MD5}, {SHA} and bcrypt. The generated hashes can be written straight into a .htpasswd file.

Main Features

  • Four hash algorithms: apr1, {MD5}, {SHA} and bcrypt
  • apr1 output matches Apache htpasswd -m exactly
  • Random salt means the same password hashes differently every time
  • One-click copy of the complete “username:hash” line
  • Demo fill and input validation built in

Use Cases / Notes

Handy when you have no shell available or need to set up Nginx / Apache directory authentication quickly. All computation happens locally, so the password never leaves your device; the username cannot contain colons or whitespace. After generating, keep the .htpasswd file outside the web root and lock down its permissions.

How to Use

  1. Enter a username and password, and choose the hash algorithm (apr1 is recommended)
  2. Click “Generate” to get a line like user:$apr1$xxxx
  3. Click “Copy” and append the result to .htpasswd, then enable authentication for the directory