Base64 Encoder & Decoder

Convert text to Base64 and back

Encode
Decode
Plain Text
Base64 Encoded

What is Base64?

Base64 is an encoding scheme that converts binary data into ASCII text. It is commonly used in email (MIME), embedding images in HTML/CSS (data URIs), and transmitting data in URLs. Each Base64 character represents 6 bits of data, making encoded output approximately 33% larger than the original.

How to Use This Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 strings back to readable text instantly. Base64 encoding is essential for embedding data in HTML, sending binary data over text-based protocols like email, and working with APIs that require Base64-encoded authentication credentials.

  1. Paste or type your text in the input field.
  2. Click Encode to convert text to Base64, or Decode to convert Base64 back to text.
  3. Copy the result with one click using the copy button.
  4. All processing happens in your browser — no data is sent to any server.
  5. Supports Unicode characters and multi-line text.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, and /). It was designed to carry data stored in binary formats across channels that only reliably support text content. The name comes from the fact that it uses a base of 64 characters.

When to Use Base64

Base64 encoding is commonly used in several scenarios: embedding images directly in HTML or CSS using data URIs, encoding email attachments via MIME, transmitting binary data in JSON or XML, HTTP Basic Authentication headers, and storing complex data in cookies or URLs. It increases data size by approximately 33%, so it is best used for small payloads.

How Base64 Works

Base64 encoding takes every three bytes (24 bits) of input and splits them into four groups of 6 bits each. Each 6-bit group maps to one of 64 characters. If the input length is not divisible by 3, padding characters (=) are added. This is why Base64 strings often end with one or two equals signs.

Base64 vs Encryption

It is crucial to understand that Base64 is NOT encryption. It is an encoding scheme that anyone can decode. Never use Base64 to protect sensitive information like passwords or API keys. For security, use proper encryption algorithms like AES-256 or hashing algorithms like SHA-256.

Frequently Asked Questions

Is Base64 encoding secure?

No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 strings. It should never be used to protect sensitive data. Use proper encryption (AES, RSA) for security.

Why does Base64 increase file size?

Base64 converts every 3 bytes into 4 characters, increasing size by approximately 33%. This is because it represents 8-bit data using only 6 bits per character, requiring more characters to store the same information.

What are the 64 characters used in Base64?

The standard Base64 alphabet consists of A-Z (26), a-z (26), 0-9 (10), plus (+) and forward slash (/), totaling 64 characters. The equals sign (=) is used for padding. URL-safe Base64 replaces + with - and / with _.

Can I encode images with this tool?

This tool encodes text to Base64. For encoding images, you would need to read the image as binary data first. Many programming languages provide built-in functions for this, such as Python's base64 module or JavaScript's btoa() function.

What is the maximum size for Base64 encoding?

There is no theoretical maximum for Base64 encoding, but practical limits depend on the application. Data URIs in HTML have browser-specific limits (typically 2-4 MB). Email attachments encoded in Base64 are usually limited by the email server's maximum message size.