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. 1

    Choose Operation

    Select 'Encode' to convert to Base64, or 'Decode' to convert from Base64 back to original.

  2. 2

    Input Your Content

    Paste text directly, or upload a file (images, documents, any binary data). Large files are supported.

  3. 3

    Process the Conversion

    Click 'Encode' or 'Decode'. Conversion happens instantly in your browser.

  4. 4

    Copy or Download Result

    Copy Base64 string to clipboard, or download decoded file. For images, preview before saving.

  5. 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

Related Tools

Frequently Asked Questions

What is Base64 used for?
Sending binary data (images, files) through text-only channels like JSON APIs, email, HTML attributes.
Is Base64 encryption?
No! Base64 is encoding, not encryption. Anyone can decode it. Never use for sensitive data without encryption.
Why does Base64 make files larger?
Base64 uses only 64 ASCII characters, so 3 bytes become 4 characters. About 33% size increase.
Can I encode large files?
Yes, but large Base64 strings are impractical. Consider file hosting for anything over 100KB.
🔒 Your files never leave your browser
100% free, no signup