How to Use the Base64 Encoder/Decoder
Base64 is an encoding scheme that converts binary data into ASCII text, making it safe to transmit through text-based protocols like email and HTTP. This tool helps you quickly encode text to Base64 or decode Base64 strings back to their original form.
- Select your mode—"Encode" to convert text to Base64, or "Decode" to convert Base64 back to text.
- Paste your input in the left panel. For encoding, enter plain text. For decoding, enter a valid Base64 string.
- Click the action button to process your input. Results appear instantly in the right panel.
- Copy the output to use in your code, API requests, or data files.
When to Use Base64 Encoding
Embedding Images in HTML/CSS
Convert small images to Base64 data URIs to embed them directly in your code, reducing HTTP requests. Use sparingly—Base64 increases file size by ~33%.
API Data Transmission
Many APIs require Base64 encoding for binary data like file uploads or authentication tokens. JSON doesn't support raw binary, so Base64 provides a text-safe alternative.
Email Attachments
MIME encoding uses Base64 to safely include binary attachments in email messages, which are inherently text-based protocols.
Basic Authentication
HTTP Basic Authentication encodes credentials as Base64. Note: Base64 is encoding, not encryption—credentials are easily decoded if intercepted.
Understanding Base64
How it works: Base64 converts every 3 bytes of binary data into 4 ASCII characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /). The = character is used for padding when input length isn't divisible by 3.
Size overhead: Base64 encoding increases data size by approximately 33%. A 1MB file becomes about 1.37MB when Base64 encoded. Consider this when deciding whether to encode large files.
URL-safe Base64: Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 replaces these with - and _ to avoid encoding issues in web applications.
Not encryption: Base64 is encoding, not encryption. Anyone can decode Base64 data—it provides no security. Never use Base64 alone to protect sensitive information.
Frequently Asked Questions
Is Base64 secure for sensitive data?
No. Base64 is encoding, not encryption. It's trivial to decode. If you need security, use actual encryption (AES, etc.) before Base64 encoding.
Can I encode files with this tool?
This tool handles text input. For binary files like images, you'll need to first read the file as binary data. Consider using a command-line tool for file encoding.
Why does my decoded text look wrong?
If the original data was binary (like an image), decoding it as text will produce gibberish. Base64 decoding is only readable when the original content was text.
Does this tool support Unicode?
Yes! This tool uses UTF-8 encoding under the hood, so characters from any language (including emoji) are properly encoded and decoded.