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?
Does this work with Postman and Insomnia?
What about accents or special characters in the password?
Related Tools
HTTP Status Codes
Look up all HTTP status codes with names and descriptions. Search by code or keyword. Quick reference for developers.
HTTP Request Builder
Build an HTTP request (URL, method, headers, body) and generate snippets in cURL, fetch, axios, Python requests and Go net/http. Everything in your browser.
OAuth2 Authorization URL Builder
Monta URL de autorização OAuth 2.0 com response_type, client_id, redirect_uri, scope, state.