HTTP Basic Auth Header Generator
Generate HTTP Basic Auth Authorization: Basic headers from username and password with correct UTF-8 base64 encoding, curl and fetch snippets, and an .htpasswd preview. Free and 100% in-browser.
Loading tool...
What is HTTP Basic Auth Header Generator?
HTTP Basic Auth Header Generator builds the Authorization: Basic header defined by RFC 7617 from a username and password. It encodes credentials as base64 with proper UTF-8 handling, adds ready-to-paste curl and fetch() snippets, and previews an Apache .htpasswd entry β all computed locally in your browser.
Key Benefits
- Correct RFC 7617 encoding, including UTF-8 passwords that break naive btoa() calls
- Copy-paste curl and fetch() snippets for instant API testing
- UTF-8 and legacy Latin-1 modes with explicit out-of-range warnings
- Fully private β credentials never leave your browser
- Free, unlimited, and works offline after the page loads
Common Use Cases
- β’Testing REST APIs that sit behind Basic Auth before writing client code
- β’Configuring reverse proxies or internal tools that prompt for Basic Auth
- β’Generating .htpasswd entries for Apache-protected directories
- β’Debugging 401 responses by comparing the Authorization header your client actually sends
How to Build a Basic Auth Header
- Enter the credentials: Type the username and password you want to encode. Everything is processed locally β nothing is uploaded.
- Pick the character encoding: Keep UTF-8 (the RFC 7617 default) for normal use. Choose Latin-1 only for legacy servers, and note it rejects non-Latin-1 characters.
- Set the endpoint URL: Enter the API endpoint you are testing so the curl and fetch snippets are copy-paste ready.
- Copy the header or snippet: Copy the Authorization header, the curl command, the fetch() snippet, or the .htpasswd preview and use it in your request.
Key Features
- Instant base64 Authorization header per RFC 7617, correct UTF-8 handling
- UTF-8 and Latin-1 modes with explicit out-of-range character warnings
- Copy-paste curl and fetch() snippets with a customizable endpoint URL
- Apache .htpasswd {SHA} entry preview generated locally via Web Crypto
- Show/hide password toggle, one-click reset, and 100% in-browser operation