Skip to content
AZ Tools

HTTP Basic Auth Encoder / Decoder

Encode username:password into the Base64 Authorization: Basic header — or paste an existing header back to see who's in it.

Base64 token
YWxpY2U6d29uZGVybGFuZA==
Authorization header
Authorization: Basic YWxpY2U6d29uZGVybGFuZA==
curl example
curl -H "Authorization: Basic YWxpY2U6d29uZGVybGFuZA==" https://api.example.com

Basic auth is just base64(user:pass). It is reversible — only safe over HTTPS, and use a different mechanism (Bearer, mTLS) when you can.

How to use

  1. Encode mode: type a username and password — the Base64 token, full Authorization header, and a curl command appear below.
  2. Decode mode: paste any Authorization: Basic … line (or just the Base64 part) to see the username and password that's inside.
  3. Copy whichever output you need — Basic creds belong only over HTTPS.

About this tool

Show

RFC 7617 Basic auth is just base64(username:password) glued onto an Authorization: Basic header. This tool does the encode and decode round-trip in the browser — no network call — and emits a ready-to-paste curl snippet. Warnings catch the common pitfalls: a colon in the username (Basic uses the first : as the divider so the credentials parse wrong), non-ASCII characters (RFC 7617 lets you pick a charset but most servers expect UTF-8), and empty credentials.

Base64 is an encoding, not encryption, and the decode direction in this very tool is the demonstration. Anyone holding the header holds the password in plain text, which makes Basic auth safe only over TLS and a poor fit for anything that gets logged. Proxies, access logs, browser history and error reports all capture request headers routinely, and a credential that appears in any of them should be treated as disclosed.

The split on the first colon is the rule worth remembering. A password may contain as many colons as it likes because everything after the first one belongs to it, but a username cannot contain one at all: the server would cut it in the wrong place and read part of the name as the start of the password. There is no escaping mechanism, so a username with a colon simply cannot be expressed.

The browser also caches Basic credentials for the realm once they are accepted, and there is no logout in the protocol. Clearing them means closing the browser, or in most clients visiting the URL with a deliberately wrong credential, which is why applications that need a real sign-out do not use Basic.

Everything here runs locally on what you type, so pasting a real credential does not send it anywhere. That is a property of this page, not of the header: once it reaches a request, it travels wherever the request travels.

Frequently asked questions

Is Basic auth secure?

Only when the connection is HTTPS. The Base64 is reversible — anyone who captures the header can decode it. Treat the token like a plaintext password.

Why does the username warning fire on a colon?

The Basic auth grammar splits on the FIRST colon. If the username contains :, the server reads everything after the first : as the password and your real password is appended to the username on the wire.

Why does the credential show up in places I did not expect?

Because the header travels on every request to that realm, and everything in the path can record it: a proxy that logs headers, an error tracker that captures the request, a browser that stores the credential for the session. Base64 is an encoding rather than encryption, so anyone holding a copy of the header holds the password itself.

What are the non-ASCII rules for the username and password?

RFC 7617 lets a server ask for UTF-8 by sending charset="UTF-8" in the challenge, but older clients and servers assumed a single-byte encoding, and the two produce different bytes for the same accented or non-Latin characters. That is why a password that works in one client fails in another with no useful error. If you cannot control both ends, keep Basic credentials to ASCII.

Related tools