🔐 Base64 Encoder & Decoder

Encode or decode Base64 text and files. Runs in your browser.

Free Base64 Encoder & Decoder

Instantly encode text to Base64 or decode Base64 back to text. Supports file-to-Base64 conversion with data URI output. Perfect for embedding images, working with APIs, or debugging encoded data. All processing happens in your browser -your data never leaves your device.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a string of printable ASCII characters. It works by taking groups of three bytes (24 bits) and splitting them into four 6-bit values, each mapped to a character from a 64-character alphabet that includes uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), plus (+), and slash (/). The equals sign (=) is used for padding when the input length is not a multiple of three. This encoding ensures that binary data can be safely transmitted through text-based protocols like email, JSON, and XML.

Developers, system administrators, and security professionals regularly work with Base64 encoding. Common use cases include embedding images in HTML or CSS using data URIs, encoding authentication credentials for HTTP Basic Auth, transmitting binary attachments in email (MIME encoding), and storing binary data in JSON APIs. This online tool lets you encode and decode Base64 instantly without installing any software. It also supports file-to-Base64 conversion with data URI output, making it easy to embed small images or files directly into your code.

How to Use This Tool

  1. Select a mode at the top: "Encode" to convert text to Base64, "Decode" to convert Base64 back to text, or "File to Base64" to encode a file.
  2. For text mode, type or paste your content into the input area. Pasting will automatically trigger the conversion.
  3. Click "Convert" to process the input. The result appears in the output area below, along with conversion time and character counts.
  4. For file mode, drag and drop a file onto the drop zone or click to browse. The Base64 string appears automatically, and you can copy it as plain Base64 or as a complete data URI.

Key Features

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is an encoding scheme, not an encryption method. It does not provide any security or confidentiality. Anyone can decode a Base64 string back to its original content. It is designed for safe data transport through text-based channels, not for hiding information.

Why does Base64 make data larger?

Base64 encoding increases the size of data by approximately 33%. This happens because every three bytes of input are represented by four Base64 characters. The tradeoff is that the output consists entirely of safe, printable ASCII characters that can pass through systems that might otherwise corrupt raw binary data.

When should I use data URIs?

Data URIs are useful for embedding small files (typically under 10KB) directly into HTML, CSS, or JavaScript. This reduces the number of HTTP requests your page makes, which can improve loading speed for small assets like icons, logos, and tiny background images. For larger files, it is generally better to use standard file URLs to avoid bloating your page size.

Does this tool handle Unicode text?

Yes. The tool properly handles Unicode text by first encoding it to UTF-8 bytes before applying Base64 encoding. When decoding, it reverses this process to restore the original Unicode characters. This means you can safely encode and decode text containing accented characters, CJK characters, emoji, and other non-ASCII content.