How to Generate an HTTP Basic Auth Header Online
To generate an HTTP Basic auth header, enter a username and password in the ByteTools Basic Auth Header Generator and copy the ready-made Authorization: Basic <base64> line — it's built from the base64 of username:password, all in your browser. The same tool decodes a header back to its credentials when you switch modes.
Basic authentication is one of the simplest, most widely supported ways to authenticate an API request. This guide shows how to build the header correctly and how to read one you've been handed.
What a Basic auth header actually is
A Basic auth header looks like Authorization: Basic dXNlcjpwYXNz. The part after Basic is simply the base64 encoding of your username and password joined by a colon — user:pass in this example. The server base64-decodes it, splits at the first colon, and checks the credentials. That's the whole mechanism: no tokens, no handshakes, just an encoded string on every request.
Step-by-step: build the header
- Open the tool in Encode mode. Go to the Basic Auth Header Generator and make sure Encode is selected.
- Enter the username. Type the account or API user. Note that the username cannot contain a colon in Basic auth.
- Enter the password. Passwords may contain colons — only the first colon separates the two fields.
- Copy the full header. The tool outputs the complete
Authorization: Basic ...line, ready to paste into a request. - Or copy the raw base64. If your client only wants the value, grab the base64 credentials on their own.
Step-by-step: decode a header
- Switch to Decode mode. Paste a full
Authorization: Basic ...header or just its base64 portion. - Read the credentials. The tool base64-decodes the value, splits at the first colon, and shows the original username and password so you can confirm exactly what a request is sending.
Using the header in a request
| Where | How you use it |
|---|---|
| curl | Paste the header after -H, e.g. -H "Authorization: Basic ..." |
| Postman / Insomnia | Drop the raw base64 into a Basic auth field, or paste the full header |
| Fetch / Axios | Set the Authorization header to the copied value |
| Config files | Store the header where the client reads request headers |
Why do this in the browser
Encoding uses UTF-8, so non-ASCII usernames and passwords work correctly. More importantly, both encoding and decoding run as client-side JavaScript — your credentials are never uploaded, logged, or stored. That makes it safe to prepare or inspect a header during development, and because ByteTools is a PWA you can even do it offline. One caution: base64 is encoding, not encryption, so a Basic header is only safe to send over HTTPS.
Try the Basic Auth Header Generator — free and 100% in your browser.
FAQ
Do I include the word "Basic" when I paste the value?
The full header includes it: Authorization: Basic <base64>. If your client has a dedicated Basic auth field, paste only the raw base64 value instead — the client adds the scheme.
Can I decode a header someone sent me?
Yes. Switch to Decode mode and paste the header or its base64 part; the tool returns the original username and password so you can verify what's being sent.
What happens if my password has a colon in it?
It's preserved. Only the first colon splits username from password, so any further colons stay part of the password. The username itself, however, can't contain a colon.
Is my base64 output the same as any other tool's?
Yes, for the same UTF-8 input. Base64 of username:password is deterministic, so the header will match what a correct server or library expects.
Related free tools
- Base64 Encoder — the encoding behind the header.
- Base64 Decoder — decode any base64 value.
- JWT Generator — build token-based auth as an alternative.
- URL Encoder — encode credentials for URL contexts.
Built by ByteVancer
ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS, and custom software. If your project needs robust authentication built properly — from APIs to full products — explore what ByteVancer can build with you.
Recommended reading
Basic Auth Headers: Tips and Security Mistakes
Best practices and the security mistakes that bite with HTTP Basic auth — HTTPS-only, base64 is not encryption, colon rules, and rotation tips.
Basic Auth Header Use Cases: Real Dev Workflows
Where a Basic auth header generator fits in real work — testing APIs with curl, Postman setup, CI secrets, webhooks, and debugging 401s.
Yes or No Generator: Real Use Cases and Examples
From beating decision paralysis to games and classrooms, see real use cases and examples for a random yes or no generator.
Yes or No Generator Tips and Common Mistakes
Get better decisions from a random yes or no generator. Pro tips, when to add Maybe, and the common mistakes to avoid when picking answers.