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.

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
Enter a username and password
Choose the hashing algorithm (bcrypt, apr1, or SHA1)
The tool generates the htpasswd entry
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

Bcrypt Hash/Verify
Hash text with bcrypt or verify text against a bcrypt hash

Basic Auth Generator
Build or decode an HTTP Basic Authorization header from user:password

Hash Generator
MD5 / SHA / CRC32 / Blake hashes and HMACs of the input text

Password Strength
Estimate password entropy, weaknesses and crack time
Use htpasswd Generator offline in Devinity
All 95 tools run locally on your Mac. No internet required, no data sent to servers.
Download Devinity →