Basic Auth Generator

Generate an HTTP Basic authentication header

Runs in your browserUtility03Encoding & Crypto

What is Basic Auth Generator?

A Basic Auth generator that joins a username and password as user:pass, Base64-encodes the pair, and returns a ready-to-use Authorization header. The header is built in the browser, and the credentials are never logged or transmitted.

How to use Basic Auth Generator

  1. 1Enter the username and password.
  2. 2Copy the generated Authorization: Basic ... header.
  3. 3Or copy the equivalent curl command snippet directly.
  4. 4When you are done, make sure the header does not get committed to a code repository.

How do I do this in code?

Use the tool above for one-off work; for anything you repeat, move it into a script or your project.

# curl supports this natively, no manual encoding needed
curl -u "user:pass" https://api.example.com

# Building the header by hand
curl -H "Authorization: Basic $(printf 'user:pass' | base64)" https://api.example.com

Common errors and how to fix them

SymptomCauseFix
Authentication keeps failing with valid credentialsThe password contains non-ASCII characters and the two sides disagree on which character encoding to use.Stick to ASCII passwords where possible, or confirm with the server that UTF-8 is expected.

Frequently asked questions

Is HTTP Basic authentication secure?+

Basic auth only Base64-encodes the credentials, which is encoding and not encryption, so it is equivalent to sending them in the clear and must always run over HTTPS. It suits internal services, quick debugging, and simple service-to-service calls; anything facing end users should use tokens or OAuth.

Are the credentials I type here stored anywhere?+

No. The username and password live only in the memory of the current page. Nothing is written to localStorage and no request is sent, so both disappear as soon as you refresh or close the tab.

Related tools

All tools