Base64 Encoder & Decoder

Convert text or files to and from Base64 format.

Operation Mode

Conversion Input and Output

Input (Enter Plain Text or Upload File Above)

0 characters

Output

Utility Actions

How it Works

  • Encode Mode: Converts input text into a Base64 string. Uploading a file will display its Base64 representation.
  • Decode Mode: Converts a Base64 string or Data URL back to its original form.
  • If the decoded content is text, it's displayed. If it appears to be binary data (like an image or application file), a download link and preview (for images) are provided.
  • UTF-8 text encoding/decoding is attempted. For files or complex data, raw byte-to-Base64 conversion is used.
  • All processing is done client-side in your browser for privacy.

Frequently Asked Questions

What is Base64?

Base64 is an encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation. It's commonly used to embed binary data (like images) in text-based formats like HTML, CSS, or JSON, or to transmit data that might otherwise be corrupted by systems designed for text.

Why use Base64 encoding?

It ensures data remains intact without modification during transport through systems that handle text. It's useful for embedding images directly into web pages (Data URLs) or sending binary data in XML or JSON payloads.

Does uploading a file send it to a server?

No. When you upload a file, it is read directly by your browser using JavaScript. The encoding or decoding happens entirely on your computer. No data is sent to any server.

What is a Data URL?

A Data URL (Uniform Resource Locator) allows embedding small files inline in documents. It typically looks like `data:[][;base64],`. This tool can decode Base64 from Data URLs and uses them internally when you upload a file for encoding.

Why does decoding sometimes result in a file download instead of text?

Base64 can represent *any* binary data, not just text. If the decoded data contains non-printable characters or its original format (if provided via Data URL) indicates a non-text type (like `image/png` or `application/pdf`), the tool assumes it's a file and provides a download link instead of trying to display potentially unreadable content.