How to Encode and Decode Base64
Base64 converts binary data to text format for safe transmission through text-only channels. Essential for developers working with APIs, email attachments, and data URIs.
64 Encode/Decode Base64 Now⚠️ The Problem
You need to embed an image in HTML as a data URI, send binary data through a JSON API, or decode a Base64 string from an email attachment. Manual encoding is error-prone and tedious.
✅ The Solution
Instantly encode text or files to Base64, or decode Base64 back to original content. Handle large files, preserve formatting, and get clean output ready for your code or documents.
Step-by-Step Guide
-
1
Choose Operation
Select 'Encode' to convert to Base64, or 'Decode' to convert from Base64 back to original.
-
2
Input Your Content
Paste text directly, or upload a file (images, documents, any binary data). Large files are supported.
-
3
Process the Conversion
Click 'Encode' or 'Decode'. Conversion happens instantly in your browser.
-
4
Copy or Download Result
Copy Base64 string to clipboard, or download decoded file. For images, preview before saving.
-
5
Use in Your Project
Paste Base64 into code, use as data URI, or save decoded file for further use.
💡 Pro Tips
- • For HTML data URIs: prefix with 'data:image/png;base64,' (adjust MIME type as needed)
- • Base64 increases file size by ~33% - don't use for large files in production code
- • JSON APIs often require Base64 for binary data since JSON only handles text
- • Decode suspicious Base64 strings carefully - they might contain executable code