htpasswd Generator - Create Apache .htpasswd Lines Online

AdSense Placeholder
Slot: header_tool

htpasswd Generator

Generate Apache .htpasswd Lines ({SHA} Format)

The htpasswd line will appear here

AdSense Placeholder
Slot: tool_mid_article

Understanding .htpasswd Files

Apache Basic Auth

Restrict access to a directory on an Apache web server using HTTP Basic Authentication.

Staging Environments

Quickly password-protect a staging or preview site without setting up a full authentication system.

{SHA} Hash Format

Generates the Base64-encoded SHA-1 digest format Apache recognizes as {SHA}... in a credentials file.

Local Processing

Your password is hashed locally with the Web Crypto API — it's never transmitted anywhere.

A Note on {SHA} vs bcrypt/apr1-MD5

Apache's htpasswd tool supports several hash formats. This generator produces the {SHA} format (Base64-encoded SHA-1), which Apache has supported since early versions and which can be computed natively in the browser via the Web Crypto API. Apache's own htpasswd CLI defaults to bcrypt on modern systems, which is stronger but cannot be computed with standard browser APIs — for bcrypt or apr1-MD5 hashes, use the htpasswd command-line tool directly on a trusted machine.

Key Takeaways

  • {SHA} Format: Produces a line in the format username:{SHA}base64(sha1(password)).
  • Native Web Crypto: Uses the browser's built-in SHA-1 implementation — no external library needed.
  • Client-Side Only: Your password is never transmitted — hashing happens entirely in your browser.
AdSense Placeholder
Slot: footer_leaderboard