Skip to content

Htpasswd Generator

Generate .htpasswd lines with bcrypt, APR1-MD5 or SHA-1.

Put it outside the document root. A .htpasswd file inside the served directory can be downloaded.

Quick Tool Overview

The Htpasswd Generator builds .htpasswd lines with bcrypt, Apache’s APR1-MD5 or SHA-1, accumulates several users into one file, and generates the Apache and nginx configuration that goes with it.

What it does
Generates .htpasswd entries and the config to use them
You give it
Usernames and passwords
You get back
A complete password file plus server config
Best for
Protecting a staging site or an internal tool
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the Htpasswd Generator

A .htpasswd file is one line per user: the username, a colon, and a hashed password. This generates those lines with any of the three hashes that matter, and builds up a multi-user file as you add entries.

bcrypt is the right choice and what Apache 2.4 and nginx both accept. APR1-MD5 — the $apr1$ format — is Apache's own and still required by some older configurations, so it is here, correctly implemented rather than approximated. SHA-1 is included because it appears in old files, with a clear warning that it is unsalted and should be replaced. The matching Apache and nginx configuration blocks are generated alongside, since the file alone does nothing.

Key features of the Htpasswd Generator

A real APR1 implementation

Apache’s $apr1$ hash is implemented properly — a thousand rounds of MD5 with its own peculiar schedule — not approximated.

bcrypt by default

The right choice for any current Apache or nginx, with the older formats available only when something forces them.

Multi-user files

Add as many users as you need and the whole file is built up, one line each.

Server config included

The Apache directory block and the nginx location block are generated too, since the file alone does nothing.

Warns about placement

The page is clear that the file belongs outside the document root, which is the mistake that makes it pointless.

How to use the Htpasswd Generator

  1. 1

    Enter a username and password

    Add as many users as you need; each becomes a line.

  2. 2

    Choose the hash

    bcrypt unless something forces otherwise. APR1 for older Apache, SHA-1 only for legacy files.

  3. 3

    Copy the file

    The complete .htpasswd contents, one user per line.

  4. 4

    Take the config

    Apache and nginx blocks are generated to go with it.

Frequently asked questions

bcrypt. Apache has supported it since 2.4 and nginx accepts it too. APR1-MD5 only if you are on something old enough to require it, and SHA-1 only when editing a file that already uses it.

Reviews of the Htpasswd Generator

What people who use the Htpasswd Generator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Htpasswd Generator. It takes half a minute and no account.

Write the first review

More developer tools