HTTP Basic Auth Header Generator

Enter a username and password to get the Base64 Authorization header for HTTP Basic authentication, plus ready-to-paste curl and fetch examples.

Use the tool

Why this tool exists

Basic auth still guards staging sites, internal APIs, webhooks and package registries. When something returns 401, you often need the exact header value to try it in curl, a proxy, a CI secret or a reverse-proxy rule. Producing it by hand means remembering to join the two with a colon, encode as UTF-8 and then Base64 the result.

This tool does those steps for you and prints the header line, a curl command and a fetch call. It also rejects a username that contains a colon, which the scheme cannot represent. Because the encoding happens in your browser, the credentials are not uploaded. Still, avoid pasting live production passwords into any page you do not fully trust.

How to use it

  1. Type the username in the first box.
  2. Type the password in the second box.
  3. Copy the Authorization header line, or the curl or fetch snippet beneath it.
  4. Use the header over HTTPS only.

Frequently asked questions

Is Basic auth encrypted?

No. The value is only Base64 encoded, which anyone can reverse in seconds. Basic auth is acceptable only over HTTPS, and even then a token-based scheme is usually safer for anything exposed to the public.

Why is a colon not allowed in the username?

The header is built from user:password, and the first colon splits the two. A colon inside the username would make the server read part of it as the password, so the tool refuses it. Colons in the password are fine.

Does it handle non-ASCII characters?

Yes. The text is encoded as UTF-8 before Base64, which is what most modern servers expect. Some very old servers assume Latin-1, so test if your password contains accented characters.

Are my credentials uploaded?

No, the encoding runs locally in your browser. Even so, treat real production secrets with care and prefer test credentials when you only need to check the format.