🛠️DevTools

HTTP Basic Auth Base64 Example

HTTP Basic Authentication requires credentials in 'username:password' format, encoded to Base64. This value goes in the Authorization header as 'Basic YWRtaW46c2VjcmV0UGFzc3dvcmQxMjM='.

Try:
23 characters
32 characters

Quick Example

helloaGVsbG8=

Common Use Cases

📷Embed images in CSS/HTML
📧Encode email attachments
🔗Send binary data via JSON APIs
📄Convert PDFs for storage

💡 Tip: Just type or paste text — output updates instantly! Base64 is commonly used for embedding images, sending data over HTTP, and more.

Code Examples

Here's how to achieve this in different programming languages:

1// Encode to Base64
2const input = "admin:secretPassword123";
3const encoded = btoa(input);
4console.log(encoded); // "YWRtaW46c2VjcmV0UGFzc3dvcmQxMjM="
5
6// Decode from Base64
7const decoded = atob("YWRtaW46c2VjcmV0UGFzc3dvcmQxMjM=");
8console.log(decoded);

Frequently Asked Questions

What is the Base64 encoding of "admin:secretPassword123"?

The Base64 encoding of "admin:secretPassword123" is "YWRtaW46c2VjcmV0UGFzc3dvcmQxMjM=". Base64 converts each character to binary, then encodes in groups of 6 bits using A-Z, a-z, 0-9, +, /.

How do I encode text to Base64?

Use btoa() in JavaScript, base64.b64encode() in Python, or 'echo -n text | base64' in Bash. Our online tool above also encodes instantly.

How do I decode Base64 back to text?

Use atob() in JavaScript, base64.b64decode() in Python, or 'echo text | base64 --decode' in Bash.

Is Base64 encoding the same as encryption?

No, Base64 is NOT encryption. It can be easily reversed by anyone. Never use it to protect sensitive data.

Why does Base64 sometimes end with = or ==?

The = signs are padding. Base64 encodes in groups of 3 bytes to 4 characters. If input isn't divisible by 3, padding is added.

More Base64 Examples

Related Base64 Tools

📚 Learn More