Basic Auth Header Generator
Build an HTTP Authorization: Basic header from a username and password, and decode one back. Basic auth simply base64-encodes username:password — it is encoding, not encryption — so this tool shows you the exact header value to drop into a curl command, an API client, or a test. Decoding goes the other way, splitting a header back into its credentials. Everything is computed locally; nothing is sent.
Encode → header
Decode ← header
How to use the Basic Auth Header Generator
Type a username and password in the encode section. The full Authorization: Basic … header and the bare base64 token both update live — copy whichever your client needs. In curl you would use -H "Authorization: Basic …" or simply -u user:pass, which builds the same header for you.
To inspect a header you already have, paste it into the decode box. The tool accepts the whole header line, just the Basic … part, or only the base64 token, and shows the username and password it contains. This is useful for debugging a request or confirming what credentials a stored header actually carries.
How HTTP Basic authentication works
HTTP Basic authentication is defined in RFC 7617. The client joins the username and password with a single colon, encodes the result as base64, and sends it in an Authorization header prefixed with the word Basic. The server decodes the token, splits on the first colon, and checks the credentials. That is the entire protocol — there is no challenge-response, no hashing, and no nonce.
The crucial point is that base64 is encoding, not encryption. Anyone who sees the header can decode it back to the plaintext password instantly, as the decode side of this tool demonstrates. Basic auth therefore provides no confidentiality on its own; its only safe use is over HTTPS, where TLS encrypts the whole request including the header. Sent over plain HTTP, the password is effectively in the clear.
Because the credentials travel with every request rather than being exchanged once for a session token, Basic auth is best suited to machine-to-machine APIs, internal tools, and quick tests rather than user-facing logins. A subtlety worth knowing: a username containing a colon cannot be represented, since the server splits on the first colon — passwords may contain colons, but usernames may not. Non-ASCII characters are encoded as UTF-8 bytes before base64, which this tool handles correctly.
Common use cases
- Calling an API. Build the exact header for a service that uses Basic auth.
- Debugging requests. Decode a captured Authorization header to see which credentials it carries.
- Scripting and tests. Generate a token to paste into a test fixture or environment variable.
- Learning the format. See plainly that Basic auth is reversible base64, not encryption.