Free tools that run in your browser. Use any tool without an account.

Favourites Cart
Sign in
Join free

Htpasswd Generator

  • Free
  • Runs in your browser
  • No account needed

This tool creates .htpasswd lines and ready Apache and Nginx snippets by hashing your password in the browser. Example: username 'user' with password 'password' becomes user:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=. Pick bcrypt cost 10 for moderate speed.

Loading the tool...

Runs in your browser. Your files and values are not sent to us. Report a problem
Advertisement

About the Htpasswd Generator

You get a browser-based htpasswd generator that never uploads your password. Enter a username and password, pick a hash type and optional bcrypt cost or salt. The tool shows a single .htpasswd line plus ready Apache (.htaccess) and Nginx snippets. Results update instantly as you type and there is no calculate button. You can copy the line or share a link that reopens the page with the same inputs. The hashes are produced in your browser, so plaintext does not leave your device. That makes the tool safer for use under GDPR, UK-GDPR, NDPR and UAE PDPL than services that post passwords to a remote server. Remember to place the .htpasswd file outside your website folder and use HTTPS for Basic Auth.

How to use it

  1. 1Enter a username.
  2. 2Type or paste the password.
  3. 3Choose Hash type and set bcrypt cost or a custom salt.
  4. 4Copy the .htpasswd line or use the share link to save your inputs.
Advertisement

Worked example

Input Username: user Password: password Hash: SHA-1 ({SHA}) Exact result user:{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g= Apache .htaccess example AuthType Basic AuthName "Restricted" AuthUserFile /path/to/.htpasswd Require valid-user Nginx snippet example location /private { auth_basic "Restricted"; auth_basic_user_file /path/to/.htpasswd; }

How it works

Inputs: Username; Password; Hash [bcrypt (recommended, Apache 2.4 and most Nginx) / APR1 MD5 (works everywhere, older) / SHA-1 {SHA} (weak, no salt)]; bcrypt cost; Salt (leave empty for a random one)Results shown: .htpasswd line; Apache (.htaccess); NginxMethod used: bcrypt uses bcryptjs at the cost you choose (each step doubles the work) with a random 22-character salt and the $2y$ prefix Apache expectsAPR1 is Apache's MD5-crypt with 1,000 rounds and an 8-character salt, the same as htpasswd -mSHA-1 is base64 of an unsalted SHA-1 hash, kept only for old serversThe password is hashed in your browser and never sent anywhereCaveat shown on the page: Basic authentication sends the password with every request, so only use it over HTTPSPut the .htpasswd file outside the website folderResults update instantly as the visitor types; there is no calculate buttonVisitors can copy the result and share a link that reopens with their numbers

Source: Apache docs: Password formatsRFC 7617: The Basic HTTP Authentication Scheme. Last checked 6 November 2026.

What it is good for

  • Hashes in your browser so plaintext never leaves your device.
  • Choose bcrypt cost for speed versus work factor control.
  • Outputs .htpasswd line plus ready Apache and Nginx snippets.
  • Basic Auth sends credentials with every request; use HTTPS.
  • Nginx bcrypt support depends on the server OS crypt() implementation; test on your host.
Advertisement

Questions people ask

Which hash should I pick?

Pick bcrypt ($2y$) when your server supports it. Use APR1 ($apr1$) if you need older Apache compatibility. SHA-1 ({SHA}) is weak and only for legacy servers.

Does this tool send my password to a server?

No. The password is hashed in your browser and not uploaded. You can confirm by checking your browser network tab.

How does bcrypt cost work?

Each increment in the cost doubles the work. Cost 10 means 2^10 work units. Higher cost is slower but harder to brute force.

Where do I put the .htpasswd file?

Put it outside the website folder so it is not web-accessible. Then point Apache or Nginx to that file path in your server config or .htaccess.

Will Nginx accept bcrypt entries?

Maybe. Nginx relies on the system crypt() library. Some systems support bcrypt and others do not. Test logins on the target host before relying on bcrypt in Nginx.

Can I share the generated line with a teammate?

Yes. You can copy the .htpasswd line or use the share link the tool provides. The link reopens the page with the same inputs so others can reproduce the output.

Help keep every tool free

FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.

Advertisement
Advertisement