1001Ferramentas
🔑 Dev

Basic Auth Generator

Generate the HTTP `Authorization: Basic <base64>` header from username and password. Useful to test APIs with basic auth via curl, Postman or fetch. Everything in your browser.

From username and password to header

The API wants basic authentication and your curl call needs the header ready. You try to build it by hand by piping user:pass into base64, forget the -n flag, a newline sneaks into the encoded value, and the server answers 401 without explaining anything. Or the password has an accent, the terminal encodes it as latin-1, and you spend twenty minutes blaming the credential.

The format is literally username, colon, password, all of it base64 encoded. The detail that trips people up by hand: the text has to become UTF-8 bytes before encoding, and the browser btoa function alone throws on accented characters. Here the conversion happens first, so a password with a cedilla comes out right. Since the colon is the separator, the username cannot contain one; the password can.

Base64 is not encryption. Anyone who sees the header decodes it in a second, so basic auth only makes sense over HTTPS, and never as credentials embedded in a URL before the at sign, which leak into shell history and proxy logs. The password box on this page shows plain text, so avoid generating production credentials while screen sharing. Everything is computed in the browser, with nothing sent to a server.

Frequently asked questions

Is Basic Auth base64 secure?
It is not. It only carries the username and password in an encoded form that anyone can reverse. The protection comes from HTTPS, not from base64.
Does this work with Postman and Insomnia?
Yes. Paste the generated value into a header named Authorization. Both clients also have a Basic auth tab that builds the same header for you.
What about accents or special characters in the password?
They work. The text is converted to UTF-8 before base64, which is what RFC 7617 recommends. The only troublesome character is a colon in the username, since that is the separator.

Related Tools