Docelora
ToolsAboutContact
Server tools

Htpasswd Generator

Password-protect a folder, staging site or admin area with HTTP basic authentication.

Quick answer: enter one username:password per line, choose the hashing method and select Generate. Upload the file outside your public folder and point your server configuration at it.

Htpasswd Generator

bcrypt · apr1 · SHA · many users

Private: everything is processed in this browser tab and never uploaded.

Hash formats

MethodLooks likeWorks with
bcryptuser:$2y$10$…Apache 2.4; nginx only with system bcrypt support
apr1user:$apr1$salt$…Apache and nginx
SHA-1user:{SHA}…Apache and nginx (legacy)

Related tools

Frequently asked questions

What is an .htpasswd file?

A text file of usernames and hashed passwords used by Apache and nginx for HTTP basic authentication – the browser login box.

Which hash method should I choose?

bcrypt for Apache 2.4. For nginx choose apr1 unless you know your system’s crypt() supports bcrypt. Use SHA-1 only for old software, as it is unsalted and fast to crack.

How do I protect a folder with Apache?

Add to that folder’s .htaccess: AuthType Basic, AuthName "Restricted", AuthUserFile /full/path/.htpasswd and Require valid-user.

How do I use it with nginx?

Inside a location block: auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd;

Where should the file live?

Outside the public web folder if possible, so it cannot be downloaded. AuthUserFile needs the full server path.

Is my password sent anywhere?

No – hashing runs in your browser using bcryptjs and Web Crypto, and the apr1 algorithm is implemented in the page itself.

Why does the hash change each time?

bcrypt and apr1 use a random salt, so the same password gives different hashes. Both still verify correctly.

Why $2y$ instead of $2b$?

Apache expects the $2y$ prefix. It is the same algorithm as $2b$.

Is basic authentication secure?

Only over HTTPS – otherwise the password travels in a readable form. Always use it with HTTPS.

Can I add more users later?

Yes – generate the new lines and append them to the existing file, one user per line.

Is there a password length limit?

bcrypt uses only the first 72 bytes, so longer passwords are rejected here for that method.

How do I find the full path on Hostinger?

In hPanel’s File Manager the path is shown at the top; it usually starts with /home/ followed by your user name.

Is it free?

Yes – no sign-up, no limits and no watermark.

Is my input uploaded?

No. Everything runs in your browser tab; nothing you paste or open is sent to Docelora.

Can I use the output in commercial projects?

Yes. What you generate is yours to use however you like.

Does it work on a phone?

Yes – the layout adapts to small screens, though long code is easier to work with on a larger display.

How do I copy the result?

Use the Copy button under the result, or Download to save it as a file.

Which browsers are supported?

Current versions of Chrome, Edge, Firefox and Safari.

Do I need to install anything?

No – it runs in your web browser, and any library it needs is loaded from Docelora the first time you use it.

Is my input kept after I close the page?

No – copy or download the result before closing the tab.

Last reviewed: 16 November 2026.