Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Htpasswd Generator API

Build an Apache/nginx .htpasswd file from username:password lines, hashed with bcrypt ($2y$), APR1-MD5 ($apr1$) or SHA-1 ({SHA}).

POST /api/v1/tools/htpasswd-generatorMCP htpasswd_generatorSecurity & PrivacyRandom output

Create .htpasswd lines for Apache or Nginx basic authentication with bcrypt, Apache MD5 (APR1) or SHA-1. Add several users at once. Runs in your browser.

Input

Send these as a JSON object. Unknown fields are rejected.

users
One user per line as username:password (the first colon splits; passwords may contain colons). Up to 50 users, or 10 with bcrypt. (string, up to 20000 characters, required)
algorithm
bcrypt (recommended), apr1 (Apache MD5, widely supported) or sha1 (legacy, unsalted). (string, one of bcrypt, apr1, sha1, default "bcrypt")
cost
bcrypt cost factor, 4 to 12. (integer, 4 to 12, default 10)
apr1Salt
Fixed APR1 salt (up to 8 characters from ./0-9A-Za-z) for reproducible output. Random when omitted. (string, up to 8 characters)
curl https://pithlab.com/api/v1/tools/htpasswd-generator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"users":"admin:s3cret-Pass\nstaging:preview-2026","algorithm":"apr1"}'