Base64 Encoder & Decoder | Free Online Base64 Conversion Tool

Encode text/file to Base64 or decode Base64 to text/file with this powerful, secure, and user-friendly tool.


How to Use Base64 Encoder & Decoder

1

Choose Encode or Decode

Click the "Encode" button to convert your text to Base64, or "Decode" to convert Base64 back to text.

2

Enter Your Text or Upload a File

Type or paste the text/Base64 string to be converted into the input field, or upload a file as an alternative.

3

Adjust Options (Optional)

If you need URL-safe encoding, make sure the "URL Safe" option is checked. This replaces characters like '+' with '-' and '/' with '_', and removes padding characters. If the "Split by Lines" option is selected, the content will be split by lines and encoded or decoded accordingly.

4

Get Your Result

The converted text or file will appear in the output box. You can copy, or download the result as needed.

Clear

Example: encode ConvertersHome (plaintext) to Base64 or decode Q29udmVydGVyc0hvbWU= (Base64) to plaintext.

The maximum file size allowed is 10MB.

Replace + with -, / with _ and remove =

Split content by lines and encodes/decodes each line.

Save to file
Copy

Embed Base64 encoded file into HTML, XML and CSS files.

Replace the MIME_type in data:[MIME_type];base64 with the actual MIME type (e.g., data:image/png;base64)

A maximum of 2KB is displayed. Click the copy button to copy the complete data, or click the download button to download the complete data.

Frequently Asked Questions About Base64

In computer programming, Base64 is a group of binary-to-text encoding schemes that transforms binary data into a sequence of printable characters, limited to a set of 64 unique characters. More specifically, the source binary data is taken 6 bits at a time, then this group of 6 bits is mapped to one of 64 unique characters.
Base64 URL encoding is a variant of the standard Base64 encoding that replaces characters that are not allowed in URLs ('+' and '/') with URL-safe characters ('-' and '_'). It also removes any trailing padding characters ('=') to make the encoded string shorter and more suitable for use in URLs and other contexts where special characters are problematic.
Base64 encoding is not a form of encryption. It does not provide any security or privacy for your data. It is simply a way to represent binary data in a text format. If you need to secure your data, you should use proper encryption algorithms such as AES or RSA in combination with Base64 encoding if necessary.

HTML JavaScript embedding:

<script type="text/javascript" src="data:text/javascript;base64,AAABAAEAAAAAAAEAIABmNQAAFgAAAO+/vVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccu..."></script>

HTML CSS embedding:

<link rel="stylesheet" type="text/css" href="data:text/css;base64,AAABAAEAAAAAAAEAIABmNQAAFgAAAO+/vVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccu..." />

HTML image embedding:

<img src="data:image/jpeg;base64,AAABAAEAAAAAAAEAIABmNQAAFgAAAO+/vVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccu..." />

XML image embedding:

<xml>
   <image>data:image/jpeg;base64,AAABAAEAAAAAAAEAIABmNQAAFgAAAO+/vVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccu...</image>
</xml>

CSS image embedding:

.myclass {
   background-image: url('data:image/jpeg;base64,AAABAAEAAAAAAAEAIABmNQAAFgAAAO+/vVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccu...');
}

Base64 encoding is commonly used for:

  • Email attachments (MIME)
  • URLs (to encode binary data)
  • Embedding images or files in HTML/CSS/JavaScript
  • Transferring data over protocols that only support text
  • Storing binary data in databases that can only store text
Base64 encoding is the process of converting binary data (such as text, images, or files) into a text-based format using the Base64 algorithm. Decoding is the reverse process, converting the Base64-encoded text back into its original binary form.
Base64 encoding increases the size of the original data by approximately 33%. This is because Base64 represents 3 bytes of data using 4 ASCII characters. Each Base64 character represents 6 bits of data, while each byte contains 8 bits. Therefore, 3 bytes (24 bits) are encoded into 4 Base64 characters (4 x 6 = 24 bits).