Skip to main content
KalkuNet

HTTP Basic Authorization Header Generator — UTF-8 Safe, with curl Examples

Encode a user name and password (UTF-8 safe) into an Authorization: Basic header with curl and HTTP examples, and decode one back.

Runs in your browserWeb · HTTP, URLs & Redirects
  • There are non-ASCII characters: encoded as UTF-8 (RFC 7617, charset="UTF-8"). Old servers that read ISO-8859-1 may reject it.
curl with the header
curl with -u (curl builds the header)
Raw HTTP request
JavaScript fetch()

Decode & verify

Paste an Authorization: Basic … line, “Basic …”, or just the Base64 token to see the name and password inside.

When to use the HTTP Authorization: Basic Header Generator

  • Correct for every character

    The name and password become UTF-8 bytes before Base64, as RFC 7617 describes, so accented letters, emoji or symbols never make btoa() fail the way many code samples online do.

  • Ready to use

    The full header, curl commands with -H or -u, a raw HTTP request and a fetch() snippet for JavaScript, each with its own copy button. Quotes in the password are escaped so the commands are safe in a terminal.

  • Decode it back

    Paste a header from a log or a config to see the name and password inside, and round-trip your own header to confirm it decodes to exactly the same pair.

  • Never leaves the browser

    Credentials are not sent to any server; encoding and decoding happen entirely on your device.

Frequently asked questions

Can the user name contain a colon?

No. RFC 7617 splits the name and password at the first colon, so a colon in the name makes the server misread it. A colon in the password is fine.

Why does btoa() fail on accented passwords?

btoa() only accepts characters with values 0–255. Text must first become UTF-8 bytes with TextEncoder and then be Base64-encoded — which is what this tool does.

What is the difference between curl -u and -H?

With -u, curl builds the Basic header itself from name:password; with -H you send a ready-made header. The server receives the same thing.

Why does the browser show a sign-in box?

The server answered 401 with a WWW-Authenticate: Basic header. The browser then asks for a name and password and sends an Authorization header like the one this tool makes.

Learn more