htpasswd Password Generator

Generate bcrypt or Apache MD5 password hashes for Apache .htpasswd files. 100% client-side — your password never leaves your device.

Use a strong, unique password. At least 12 characters recommended.
Copied!
—

How it works

An htpasswd file stores lines in the form username:hash. This tool creates the hash using one of two algorithms. For bcrypt, it generates a fresh 16-byte random salt, encodes it in the OpenBSD base64 alphabet, and runs the Blowfish-based Eksblowfish key schedule with the chosen cost factor (2^rounds iterations) to derive a 23-byte hash, producing the familiar $2y$NN$...$... format. For Apache MD5 (apr1), it generates an 8-character salt and performs 1000 rounds of the MD5-based digest mixing password, salt, and a magic constant, yielding the $apr1$salt$hash format.

Frequently Asked Questions

What is an htpasswd file and how does it work?

An .htpasswd file is a plain-text file used by the Apache web server (and compatible servers like Nginx) to store usernames and password hashes for Basic HTTP Authentication. Each line contains a username followed by a colon and a hashed password, for example: admin:$2y$10$abcd.... When a user logs in, the server hashes the entered password with the same algorithm and salt and compares it to the stored hash.

Should I use bcrypt or MD5 for htpasswd?

Always prefer bcrypt ($2y$) over MD5. MD5 (both plain and Apache's apr1 variant) is considered weak against modern brute-force and GPU attacks. Bcrypt is deliberately slow, salted, and uses a cost factor (rounds) that can be increased over time. Only use Apache MD5 (apr1) for backward compatibility with very old servers.

Is it safe to generate htpasswd hashes in my browser?

Yes, when the tool runs 100% client-side with no network calls, your password never leaves your device. This htpasswd generator is pure JavaScript and hashes everything locally. For maximum security, run it offline, use a strong random password, and delete the page from your browser history afterwards.

Free tools by TUNA — energy supply from vetted manufacturers