Base64 Encoder / Decoder

Encode text or files to Base64, or decode Base64 strings back to plain text. Instant results, no login required.

🔐 Base64 Tool

Input (Plain Text)
Output (Base64)

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses a set of 64 characters — uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), plus (+), and slash (/) — along with the equals sign (=) for padding. The result is a text-safe representation of any binary data.

Base64 encoding increases the size of data by approximately 33%. For example, a 3-byte input becomes 4 Base64 characters. Despite this overhead, Base64 is invaluable for safely transmitting binary data through text-only channels.

Common Use Cases

Email attachments (MIME): Email protocols like SMTP were designed for text. Binary attachments (images, PDFs) are Base64-encoded so they can be safely included in email messages.

Data URLs: Small images can be embedded directly in HTML or CSS using data:image/png;base64,... syntax, eliminating extra HTTP requests.

API data transfer: REST APIs often use Base64 to embed binary data (files, images) within JSON payloads, since JSON only supports text.

HTTP Basic Authentication: The Authorization header encodes the username:password string in Base64 (e.g., Authorization: Basic dXNlcjpwYXNz).

Encoding vs Encryption

Base64 is not encryption. It is a reversible encoding — anyone can decode a Base64 string without a key or password. It provides no security or confidentiality. Encryption algorithms like AES or RSA require a secret key to decrypt data. If you need to protect sensitive data, use proper encryption, not Base64.

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding that represents binary data using 64 ASCII characters. It is used to safely transmit binary data over text-based protocols like email, HTTP, and JSON APIs.
How do I encode a string to Base64?
Paste your text into this tool and click Encode. In JavaScript, use btoa() for simple strings or TextEncoder + manual conversion for Unicode text.
How do I decode a Base64 string?
Paste the Base64 string into this tool and click Decode. In JavaScript, use atob() to convert Base64 back to a plain string.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption. Anyone can decode it without a key. For security, use proper encryption algorithms like AES or RSA.
What is Base64 used for?
Common uses: email attachments (MIME), data URLs in HTML/CSS, binary data in JSON APIs, HTTP Basic Auth headers, and storing binary data in text-based formats like XML.