Skip to main content
SecurityFreeBy Daniel BeglaryanUpdated August 2026

Generate .htpasswd Files

Create bcrypt or SHA-1 password lines for Apache and Nginx basic auth.

PrivateWorks OfflineNo Account
Hashing algorithm

Recommended. Salted and deliberately slow — the modern default for Apache 2.4+ and Nginx. A higher cost is harder to brute-force but slower to check.

Users
Deep dive

About Generate .htpasswd Files.

Generate .htpasswd lines for Apache and Nginx

Basic authentication guards a directory or an admin path with a username and password, and both Apache and Nginx read those credentials from a small text file — usually named .htpasswd. This tool builds that file for you: type a username and password, pick bcrypt or SHA-1, and copy the user:hash line straight into your server config. Add as many users as you need and download the whole file at once.

Every password is hashed locally in your browser with bcryptjs and the Web Crypto API — nothing is uploaded. That matters here more than for most tools: plenty of online htpasswd generators send the exact password you are trying to protect to a server you do not control. This one never makes a network request, so the secret never leaves your machine.

bcrypt is the right choice for any current server (Apache 2.4+ and Nginx): it is salted and deliberately slow, so a stolen file resists brute-force, and a higher cost factor makes it slower still. SHA-1 is included only for legacy systems — it is unsalted and fast to crack, so avoid it unless an old server gives you no other option. One honest caveat: bcrypt only uses the first 72 bytes of a password, and the tool warns you when a password is longer than that.

  • Lock a staging site: Gate a not-yet-public build behind one login before you share the URL with a client.
  • Protect an admin URL: Put basic auth in front of /wp-admin, a phpMyAdmin install, or an internal metrics dashboard.
  • Add a teammate: Generate a fresh line for a new user and paste it onto the end of your existing .htpasswd file.
  • Rotate a password: Re-hash an account after someone leaves, without ever exposing the old credential.
  • Move off SHA-1: Regenerate an old {SHA} file with bcrypt to harden a server that was set up years ago.
  • Seed a container or CI config: Produce the exact AuthUserFile contents to drop into a Dockerfile, Ansible role, or Nginx image build.

Privacy: This tool runs entirely in your browser. Usernames and passwords are hashed on your device and are never uploaded, logged, or stored — close the tab and nothing remains.

Three steps

How to use Generate .htpasswd Files.

01

Upload your file

Drag and drop or click to select your file.

02

Choose settings

Adjust quality, size, or format options.

03

Download result

Your processed file is ready instantly.

More in Security

Related security tools.

Why CipherForces

Privacy-first tools that work everywhere.

100% Private
From $39
Works Offline
No Account
188 Tools

Need more than a tool?

One team for your website, print, automation & branding — websites from $799.

Explore all 188 tools