htpasswd Generator

Create .htpasswd entries to password-protect a site or folder with HTTP basic auth. Enter one or more usernames and passwords, pick the hash format, and copy or download the file — with ready-made Apache and Nginx configuration. Your passwords are hashed in your browser and never sent anywhere.

Formats

PrefixAlgorithmSupported by
$apr1$Salted MD5, 1,000 roundsApache, Nginx
{SHA}Unsalted SHA-1Apache, Nginx
$2y$bcryptApache 2.4+, Nginx with system crypt

When to use it

  1. Protect a staging site with a password.
  2. Lock down an admin folder on Apache.
  3. Add basic auth in front of an Nginx app.
  4. Create logins for several users at once.

How to Use

  1. Enter usernames and passwords.
  2. Choose the algorithm.
  3. Copy or download the .htpasswd file and add the config.

Features

  1. APR1-MD5 and SHA-1
  2. Matches htpasswd/OpenSSL output
  3. Multiple users
  4. Download .htpasswd
  5. Apache and Nginx config
  6. Hashed locally

FAQs

Which algorithm should I use?

APR1-MD5 works in both Apache and Nginx. For stronger hashing, use bcrypt with `htpasswd -B` on the server.

Is it safe to type my password here?

The hash is computed in your browser; nothing is sent. You can disconnect from the internet to be sure.

Why is each hash different for the same password?

A random salt is used every time, which is expected.

Where does the file go?

Outside your web root, referenced by AuthUserFile (Apache) or auth_basic_user_file (Nginx).

Can usernames contain colons?

No — the colon separates the username from the hash.

Technical Details

APR1-MD5 is Apache's variant of the md5crypt algorithm: a random 8-character salt, an initial digest mixing password, salt and password, then 1,000 rounds of MD5 that alternate password, salt and the previous digest, and finally a custom base-64 encoding with the alphabet ./0-9A-Za-z, prefixed with $apr1$. The output is identical to `htpasswd -m` and `openssl passwd -apr1` and is verified against OpenSSL in the tool's test suite. The SHA-1 option is base-64 of an unsalted SHA-1 digest prefixed with {SHA}, which Apache and Nginx accept but which is weak against cracking. Usernames containing a colon are rejected because the colon separates user and hash. Salts come from the browser's cryptographic random generator.

Security Tools

Security Tools

  • Common Port Reference
  • Google Dork Generator
  • Google Search Operators
  • CRC Generator
  • Vigen\u00e8re Cipher
  • TOTP Generator
  • Passphrase Generator
  • JWT Generator & Decoder