Generate htpasswd

Create a legacy Apache {SHA} htpasswd line from a password.

freeworks offlinenothing uploaded
ToolHtpasswd Generator
Input
Output

How it works

The password is UTF-8 encoded, hashed with SHA-1, Base64 encoded without padding, and prefixed with the Apache {SHA} marker beside the username. The result is one line for a file-based Basic Authentication database.

  • The format is retained for Apache compatibility.
  • Salted bcrypt or another modern scheme is preferred for new public systems.

Worked example

A single user line
Username and password to a ready-to-paste htpasswd line
Input
											Username: admin
Password: secret123
										
Output
												Line: admin:{SHA}8rFPaOuZX6yzocNSh7d41b14VRE=
Username: admin
Hash format: {SHA}
Hash: 8rFPaOuZX6yzocNSh7d41b14VRE=
											

When to use this

Apache staging protection, reverse-proxy test gates, and credential migrations create htpasswd lines.

Edge cases

  • Identical passwords create identical unsalted lines.
  • Non-ASCII passwords must use the same UTF-8 encoding when verified.
  • A valid legacy line is not a modern password database.

References