Use Basic Auth Header Generator

Enter your data below to use the Basic Auth Header Generator

📌 Try these examples:
RESULT

Last updated

Security Reminders

The generator runs entirely in your browser. Credentials you enter are never sent to any server, making it safe to use with real passwords during development and debugging.

Examples

Example 1: Generating a Basic Auth Header for an API Request

A developer needs to call an internal REST API that uses Basic Authentication. They enter the credentials into the generator:

Username: admin
Password: s3cur3P@ssw0rd

Encoding process:
  1. Concatenate: "admin:s3cur3P@ssw0rd"
  2. Base64 encode: "YWRtaW46czNjdXIzUEBzc3cwcmQ="

Generated header:
  Authorization: Basic YWRtaW46czNjdXIzUEBzc3cwcmQ=

The generator displays the header in multiple ready-to-use formats:

curl command:
  curl -H "Authorization: Basic YWRtaW46czNjdXIzUEBzc3cwcmQ=" https://api.example.com/data

JavaScript fetch:
  fetch('https://api.example.com/data', {
    headers: {
      'Authorization': 'Basic YWRtaW46czNjdXIzUEBzc3cwcmQ='
    }
  });

Python requests:
  import requests
  response = requests.get(
    'https://api.example.com/data',
    auth=('admin', 's3cur3P@ssw0rd')
  )

Example 2: Decoding a Basic Auth Header for Debugging

A developer is debugging an authentication issue. The API logs show an Authorization header but the credentials are not obvious. They paste the header value into the decoder:

Input header value: Basic dGVzdHVzZXI6dGVzdHBhc3M=

Decoded:
  Base64 string: dGVzdHVzZXI6dGVzdHBhc3M=
  Decoded text:  testuser:testpass
  Username:      testuser
  Password:      testpass

The decoder reveals that the client is sending test credentials instead of production credentials. The developer identifies the misconfigured environment variable and fixes it.

Example 3: Handling Special Characters in Passwords

A password containing special characters like colons, at signs, and slashes needs careful handling. The generator correctly encodes these:

Username: api_user
Password: p@ss:w/ord#2024!

Concatenated: "api_user:p@ss:w/ord#2024!"
  Note: The colon in the password is included as-is.
  The FIRST colon is the username:password separator.
  All subsequent colons are part of the password.

Base64 encoded: YXBpX3VzZXI6cEBzczoody9vcmQjMjAyNCE=

Authorization: Basic YXBpX3VzZXI6cEBzczoody9vcmQjMjAyNCE=

The generator handles all special characters correctly, including colons within the password, which is a common source of encoding errors when done manually.

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.

Yes! Basic Auth Header Generator is completely free to use with no registration required. All processing is done client-side in your browser.

Absolutely! All processing happens locally in your browser. Your data never leaves your device, ensuring complete privacy and security.