Generators

htpasswd Generator

Generate htpasswd file entries for Apache or nginx basic authentication. Enter a username and password, choose the hashing algorithm (bcrypt, apr1 Apache MD5, or SHA1), and get a line ready to paste into your .htpasswd file. Bcrypt is the recommended algorithm — it's slow by design, making brute-force attacks impractical.

htpasswd Generator — Generate htpasswd entries with bcrypt, apr1 (Apache MD5), or SHA1 hashing

What it does

  • Generates htpasswd entries with bcrypt hashing (recommended)
  • Generates entries with apr1 (Apache MD5) for legacy compatibility
  • Generates entries with SHA1 for older systems
  • Outputs the full htpasswd line: username:hashed_password
  • Adjustable bcrypt cost factor

Use cases

  • Setting up basic authentication for an Apache or nginx server
  • Adding a new user to an existing .htpasswd file
  • Generating credentials for a reverse proxy authentication layer
  • Testing different hashing algorithms for htpasswd compatibility

How it works

1

Enter a username and password

2

Choose the hashing algorithm (bcrypt, apr1, or SHA1)

3

The tool generates the htpasswd entry

4

Copy the line and append it to your .htpasswd file

Frequently asked questions

1Which algorithm should I use?

Bcrypt is the most secure option and is supported by Apache 2.4+ and nginx. Use apr1 (Apache MD5) if you need compatibility with older Apache versions. Avoid SHA1 — it's fast and vulnerable to brute-force attacks. Never use plaintext (crypt) in production.

2What's the apr1 format?

apr1 is Apache's variant of MD5 with a salt. The output looks like $apr1$salt$hash. It's more secure than plain MD5 because of the salt, but it's still MD5-based and not as strong as bcrypt. Use it only when bcrypt isn't available.

3Can I generate multiple users at once?

Generate each user one at a time and append each line to your .htpasswd file. Each line is independent — the file is just a list of username:hash pairs, one per line.

Related tools

Use htpasswd Generator offline in Devinity

All 95 tools run locally on your Mac. No internet required, no data sent to servers.

Download Devinity →