.htpasswd Generator
Create secure basic authentication credentials for Nginx, Apache, or Traefik. Your passwords are hashed entirely within your browser using JavaScript cryptography. We never transmit or log your sensitive passwords.
Hashed 100% locally in your browser.
How ZeroData protects your privacy
- ✓ No Uploads: Processing happens entirely via client-side JavaScript.
- ✓ No Storage: We do not have a database. We physically cannot save your data.
- ✓ No Tracking: We don't log what you process or track your inputs.
- ✓ Verifiable: Check your DevTools Network tab. You will see 0 outbound requests.
How to Use with Nginx
Once you generate your credentials, save them in a file (e.g., /etc/nginx/.htpasswd). Then, update your Nginx configuration:
location /admin/ {
auth_basic "Administrator Login";
auth_basic_user_file /etc/nginx/.htpasswd;
} Bcrypt vs SHA-1 vs Plaintext
Bcrypt is the only algorithm you should use in production. It includes a random salt and a configurable work factor (cost), making it extremely resistant to brute-force attacks. Each increment of the cost factor doubles the computation time.
SHA-1 is a legacy option. While it is fast, modern GPUs can crack SHA-1 hashes at billions of attempts per second. Only use it if your server explicitly requires it.
Plaintext stores the password as-is. This is only acceptable in isolated testing environments that are never exposed to the internet.
Zero Data Guarantee
Unlike most online .htpasswd generators that send your plaintext password to a backend PHP server, this tool compiles the Bcrypt algorithm into JavaScript. The hashing happens on your CPU. Disconnect from the internet, and this tool will still work.
Common Use Cases
- Protecting Nginx admin panels and staging environments with HTTP Basic Authentication.
- Creating credentials for Apache .htaccess password-protected directories.
- Generating secure Bcrypt hashed passwords for Traefik reverse proxy authentication.
- Setting up basic auth on development and staging servers before exposing them to the internet.
- Creating seed credentials for Docker containers that require HTTP Basic Auth.
Frequently Asked Questions
What is an .htpasswd file?
An .htpasswd file is a flat-text file used by Apache and Nginx web servers to store usernames and hashed passwords for HTTP Basic Authentication. Each line contains a username:hash pair. The server reads this file to verify credentials when a user accesses a protected directory or resource.
Which hashing algorithm should I use?
Bcrypt is the recommended algorithm. It includes a built-in salt and configurable cost factor, making it resistant to brute-force and rainbow table attacks. Apache 2.2.18+ and modern Nginx both support Bcrypt natively. Use SHA-1 only if you are supporting a legacy system that cannot handle Bcrypt.
Is it safe to generate passwords here?
Yes. The bcryptjs library runs entirely in your browser using JavaScript. Your plaintext password is hashed locally on your CPU and is never transmitted to any server. You can disconnect from the internet and this tool will still work.
How do I use the generated credentials with Nginx?
Save the generated username:hash line into a file (e.g., /etc/nginx/.htpasswd), then add an auth_basic directive to your Nginx server block or location block. Use auth_basic_user_file to point to your .htpasswd file path. Reload Nginx with nginx -s reload to apply the changes.
What does the $2y$ prefix mean?
The $2y$ prefix identifies a Bcrypt hash. It was introduced in PHP's crypt() function as a fixed version of the original $2a$ algorithm. Apache and Nginx both accept $2y$ hashes natively. This tool generates $2y$ prefixed hashes for maximum server compatibility.
Related Tools
Bcrypt Hash Verifier
Verify bcrypt password hashes and generate new ones entirely in your browser. Your passwords never leave your machine.
Nginx Config Generator
Generate Nginx server block configurations visually. Reverse proxy, SSL, gzip, and security headers — 100% browser-based.
Nginx Rewrite Rule Generator
Generate Nginx rewrite and redirect rules visually. Configure path matching, regex patterns, flags, and condition checks locally.
Nginx Rate Limiting Configurator
Generate Nginx rate limiting directives visually. Configure limit_req_zone, burst, nodelay, and custom 429 error pages — 100% browser-based.