HTTP Basic Authentication Explained
Basic Authentication
Basic Auth Format
HTTP Basic Authentication encodes username:password as Base64 and sends it in the Authorization header. Paste credentials to generate a ready-to-copy header value.
Real-World Examples
user:pass → Authorization: Basic dXNlcjpwYXNz
curl: curl -u user:pass https://api.example.com
API keys sent as username with empty password (provider-specific pattern)
Common Mistakes
- Sending Basic Auth over plain HTTP — credentials are trivially decodable
- Treating Base64 encoding as encryption
- Embedding credentials in client-side JavaScript — always proxy through your backend
Security Considerations
Use Basic Auth only over HTTPS. Prefer token-based auth (Bearer, OAuth) for user-facing applications. Clear sensitive input after testing on shared machines.
Frequently asked questions
Is Basic Auth secure?
Only over HTTPS. Base64 is encoding, not encryption. Never send Basic Auth credentials over plain HTTP.
What header format is produced?
The output is a complete Authorization header value: Basic followed by the Base64-encoded username:password string.
Are my credentials sent to a server?
No. Header generation runs entirely in your browser.