.htpasswd Generator (bcrypt)
Generate Apache .htpasswd lines using bcrypt. Works for nginx auth_basic too. 100% in your browser.
UsernamePassword
Cost 10 ≈ 100 ms per hash. Higher = more secure but slower.
About .htpasswd Generator (bcrypt)
The .htpasswd Generator creates a credential line for HTTP basic authentication. Enter a username and password and the tool hashes the password with bcrypt, then outputs a single line in the username:hash format that Apache and nginx both accept. Copy the line into your .htpasswd file to protect a directory or site behind a login prompt.
The bcrypt hashing runs in your browser, so the password you type is never sent to a server. Each generation uses a fresh random salt, which means running it twice for the same password produces different hashes, and both remain valid.
Frequently asked questions
- Does this work with nginx?
- Yes. The bcrypt format is supported by the nginx auth_basic module as well as Apache.
- Why does the hash change every time?
- Bcrypt includes a random salt in each hash, so repeated runs differ while still verifying the same password.
- Can I add several users?
- Generate one line per user and place each on its own row in the .htpasswd file.