Choose Encode or Decode
Click the "Encode" button to convert your text to Base64, or "Decode" to convert Base64 back to text.
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.
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.
Get Your Result
The converted text or file will appear in the output box. You can copy, or download the result as needed.
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.
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.
Find answers to common questions about Base64
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: