Tools / Basic Auth Header Generator

Basic Auth Header Generator.

Build an HTTP Basic Authorization header from a user name and password, or decode an existing one.

Runs in your browser

Ctrl/⌘ + Enter to run · Ctrl/⌘ + Shift + C to copy the result

Result
Header
Usage
Details

About Basic Auth Header Generator

The Basic Auth Header Generator builds the Authorization header for HTTP Basic authentication (RFC 7617) and decodes existing headers. Basic authentication joins the user name and password with a colon, encodes the result as Base64 and sends it as "Authorization: Basic <token>". With the RFC's own example, user Aladdin and password "open sesame", the header is Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==. Besides the header, the tool prints ready-to-use curl and fetch snippets, so you can test an API, a webhook endpoint, a staging site behind nginx auth_basic or a Docker registry straight away. Decode mode accepts the full header, "Basic …" or just the Base64 part and shows the user name and password, which helps when you need to check what a client or a CI secret actually sends. Typical mistakes it catches: a colon in the user name (the server splits at the first colon, so this is not allowed), a header that uses a different scheme such as Bearer, Base64 that was truncated, and credentials that were encoded with a different character set; non-ASCII characters are encoded as UTF-8, and the tool notes that the server must expect charset="UTF-8". Remember that Base64 is an encoding, not encryption: anyone who sees the header can read the password, so Basic authentication is only acceptable over HTTPS, and passwords for .htpasswd files should be stored as hashes, not as this header. The page is marked sensitive, so credentials are never stored in the URL or history, and everything is computed in your browser.

How to Use

  1. Enter the user name and password, or switch to decode and paste a header.
  2. Copy the Authorization header or one of the curl / fetch snippets.
  3. Send it only over HTTPS.

Frequently Asked Questions

Is Basic authentication secure?

Only over HTTPS. The credentials are Base64-encoded, not encrypted, so anyone who can see the request can decode them.

Can the user name contain a colon?

No. The server splits the decoded value at the first colon, so a colon in the user name would shift part of it into the password. The password may contain colons.

How are non-ASCII characters handled?

They are encoded as UTF-8, as RFC 7617 recommends with charset="UTF-8". Very old servers may expect ISO-8859-1 instead.

Are my credentials sent anywhere?

No. The header is built in your browser, and the page does not save inputs in the URL or history.

Related Tools