Skip to content

Menu

Basic Auth Generator

Generate and decode HTTP Basic Authentication headers with code examples.

Runs entirely in your browserAuth & SecurityFree, no sign-up
Loading tool

01What is Basic Auth Generator?

Sometimes you just need a working Authorization header for a quick curl call, and typing Base64 by hand is no fun. Basic Auth Generator builds the HTTP Basic Authentication header defined in RFC 7617. It joins the username and password with a colon, encodes that text as UTF-8 and then as Base64, and prints the result three ways: the bare Base64 value, the full Authorization: Basic header, and ready-made curl and fetch() snippets. For the classic RFC example, Aladdin and open sesame give QWxhZGRpbjpvcGVuIHNlc2FtZQ==. Encoding as UTF-8 first matters for anything beyond plain ASCII: josé with the password pässwörd becomes am9zw6k6cMOkc3N3w7ZyZA==, which is what curl and modern servers expect, and names in Chinese, Arabic or with emoji work too instead of failing. The spec itself is short. RFC 7617 replaced the older RFC 2617 text and added the optional charset="UTF-8" parameter that servers can send in their WWW-Authenticate challenge. That parameter is the reason UTF-8 is the safe default today. The Decode tab does the reverse. Paste a raw Base64 string, a Basic value or a whole Authorization: Basic header line and it shows the username and password, splitting at the first colon as servers do. If the bytes aren't valid UTF-8, it falls back to Latin-1, which is what some older clients send. A username containing a colon gets a warning, because RFC 7617 doesn't allow it: the server would treat everything after the first colon as the password. An empty password is fine too. The username deploy with no password encodes as ZGVwbG95Og==, keeping the trailing colon so the server still sees two parts. The banner at the top is the most important part. Base64 is an encoding, not encryption, so anyone who sees the header, in a proxy log, a screenshot or a shared curl command, can read the password back in a second. Basic Auth is only acceptable over HTTPS. Everything runs in your browser and nothing is sent anywhere, but you should still use test credentials rather than real ones in any web tool. One honest limit: the tool only builds and reads the header. It can't tell you whether the server will accept those credentials, and it doesn't handle other schemes such as Digest or Bearer tokens.

Backend and DevOps developers use it to build or inspect Basic Auth headers when testing protected endpoints, proxies and staging sites. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Basic Auth Generator

  1. On the Encode tab, enter the username and password; use the eye icon to show the password.
  2. Copy the Base64 value, the full Authorization header, or the curl or fetch() example.
  3. To decode, switch to the Decode tab and paste a Base64 string, a Basic value or a full Authorization header.
  4. Read the decoded username and password and copy either one if you need it.

03Worked examples

Input: Username Aladdin, password open sesame
Result: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
This is the worked example from RFC 7617, so you can use it to check any other implementation.
Input: Username admin, password password123
Result: Authorization: Basic YWRtaW46cGFzc3dvcmQxMjM=
The header is just Base64 of "admin:password123"; anyone who sees it can decode the password, so it is not encryption.
Input: Decode "Authorization: Basic dXNlcjpwOnNz"
Result: username: user, password: p:ss
Decoding splits on the first colon only, so a colon inside the password survives; a colon in the username would not.
Input: Username josé, password pw
Result: Authorization: Basic am9zw6k6cHc=
Credentials are encoded as UTF-8 bytes before Base64, so é takes two bytes (w6k in the output).
Input: Username deploy, empty password
Result: Authorization: Basic ZGVwbG95Og==
The colon is still included, so the decoded value is "deploy:" with an empty password.
Input: Decode "Zm9vYmFy"
Result: Invalid Basic Auth header
Zm9vYmFy is valid Base64 for "foobar", but it contains no colon, so it cannot be split into a username and password.

04Common use cases

  • Building an Authorization header for a curl command against a protected test or staging endpoint
  • Checking which username a Basic Auth header in a captured request or log actually carries
  • Confirming how non-ASCII usernames or passwords are encoded before debugging a 401
  • Pasting a fetch() snippet into a quick script that calls an API protected by Basic Auth
  • Decoding the header from a browser DevTools request to see why a reverse proxy like Nginx keeps returning 401
  • Writing an expected header value into an API test or mock server fixture

05Tips

  • Base64 is not encryption: always use HTTPS with Basic Auth, and never paste a production header into chat, tickets or logs
  • curl can build the same header for you with -u user:password; the generated header is handy when a tool only accepts raw headers
  • Usernames must not contain a colon; passwords may, because only the first colon separates the two
  • For machine-to-machine access, prefer scoped API tokens or OAuth, which can be revoked per client without changing a shared password
  • If a decoded username looks garbled, the client probably sent Latin-1 rather than UTF-8. The decoder falls back to Latin-1 for you, but the fix belongs in the client.

06Related concepts

HTTP authentication, Base64 encoding, Authorization header, RFC 7617.

Frequently Asked Questions

What is Basic Auth Generator?

Basic Auth Generator is a free, browser-based developer tool on AIDToolStack. Generate and decode HTTP Basic Authentication headers with code examples. It requires no installation or sign-up and works entirely in your browser.

Is Basic Auth Generator free to use?

Yes. No sign-up, no fees and no usage cap.

Does Basic Auth Generator store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe