Free Htaccess Password Generator
Protecting a staging site or private directory with Apache? You need a .htpasswd file — and passwords in it must be hashed, not plaintext. The Htaccess Password Generator creates bcrypt-hashed username:hash lines ready to drop into .htpasswd, plus the .htaccess snippet to enforce them. Generate, copy, deploy.
How to Use the Htaccess Password Generator
- Enter a username and a strong password.
- Click Generate to create the user:$2y$… line.
- Copy or download the line into your .htpasswd file (outside the web root).
- Point Apache at it with AuthUserFile in your .htaccess — see the snippet below.
Features
Bcrypt-hashed entries; username validation; cost selection; .htaccess snippet included; copy and download.
Benefits & Use Cases
Lock down staging environments, protect private downloads, gate admin panels on shared hosting, or add a quick auth layer to any Apache directory.
Tips
Store .htpasswd outside the web root so it's never downloadable. Always serve password-protected areas over HTTPS, and use strong unique passwords even behind basic auth.
Frequently Asked Questions
What is a .htpasswd file?
It is Apache's password file for HTTP basic authentication. Each line holds a username and hashed password; Apache checks credentials against it before serving protected content.
Why bcrypt instead of MD5?
Apache's old MD5 format is fast to crack. Bcrypt with cost 10+ resists brute force, and modern Apache versions support it via the $2y$ prefix this tool generates.
Where do I put the .htpasswd file?
Anywhere outside your public web directory, then reference the full path with AuthUserFile in .htaccess. Never place it where browsers can download it.
Can I add multiple users?
Yes — generate one line per user and append each to the same .htpasswd file, one per line.
Is basic auth secure?
With bcrypt hashes, HTTPS, and strong passwords, it is reasonable for low-risk areas. For sensitive apps, prefer full application-level authentication with sessions and 2FA.
Related Tools
Bcrypt Hash Generator
Hash passwords with bcrypt free with NToolHub. Adjustable cost factor, plus password verification against hashes — 100% in your browser, nothing uploaded.
Open tool →Basic Auth Generator
Build HTTP Basic Auth headers free with NToolHub. Base64 credentials with a ready curl example — Unicode-safe, 100% in your browser, nothing uploaded.
Open tool →Password Generator
Generate strong, random passwords free with NToolHub. Set length and character sets, check entropy live — everything runs 100% in your browser.
Open tool →Strong Password Generator
Create extra-strong passwords and memorable passphrases free with NToolHub. Bulk-generate up to 20 at once with secure randomness, in your browser.
Open tool →Password Strength Checker
Test your password strength free with NToolHub. Entropy scoring, common-password detection and crack-time estimates — analyzed 100% in your browser.
Open tool →