Apache basic auth

Htpasswd Generator

Generate Apache "SHA" format htpasswd lines (the same as htpasswd -s), computed entirely client-side with the Web Crypto API.

.htpasswd file

Format: username:{SHA} + base64-encoded SHA-1 digest of the password. This is legacy and unsalted — fine for gating a staging site behind basic auth, not for real account security.

How it works

1

Add username/password rows

Enter as many basic-auth users as you need.

2

SHA-1 hashing happens locally

The Web Crypto API hashes each password right in your browser.

3

Copy or download

Grab the full .htpasswd file, one line per user, ready for Apache.

FAQ

What format does this generate?

It generates the Apache "SHA" htpasswd format, the same output as running htpasswd -s: username:{SHA} followed by the base64-encoded SHA-1 digest of the password.

Is the SHA htpasswd format secure?

Not by modern standards. It is unsalted, so identical passwords always produce identical hashes and it's vulnerable to precomputed lookup tables. Use it only for low-stakes basic-auth gating (like blocking a staging site), never for real account security.

Does Apache support stronger formats?

Yes, Apache's htpasswd tool also supports bcrypt and APR1-MD5, which are salted and far more resistant to cracking. Those require a proper crypt implementation that isn't attempted in a lightweight client-side tool like this one — use the real htpasswd command-line tool if you need them.

Try other tools