Base64 Encoder & Decoder

Encode and decode text, UTF-8 strings, and files to Base64 and URL-safe Base64.

Tool Guide

Base64 Encoder & Decoder: What It Does

Converts plain text and binary files to RFC 4648 Base64 strings, or decodes Base64 back to plain text. It handles multi-byte UTF-8 characters and emoji without truncation, and provides a URL-safe alphabet mode.

Example

Input
Hello
Output
SGVsbG8=

Packs UTF-8 byte sequences into 6-bit ASCII characters.

How to Use

  1. Type or paste text into the input field, or drag and drop a file.
  2. Select Encode or Decode mode.
  3. Toggle URL-safe mode when embedding tokens into query strings or HTTP headers.

Limitations

  • Base64 encoding increases overall payload size by approximately 33%.
  • Corrupt Base64 input reports a decode error with character offset.

Frequently Asked Questions

Why does standard window.btoa fail on emoji and accented text?

The legacy btoa API expects Latin-1 binary strings. This encoder passes text through TextEncoder first, ensuring complete multi-byte UTF-8 compliance.

What is the difference between standard and URL-safe Base64?

URL-safe mode replaces plus (+) with hyphen (-) and slash (/) with underscore (_) so strings pass safely through URLs without percent-encoding.

Command-Line Equivalent
echo -n Hello | base64

Encode stdin to Base64 on the command line.

Embed or Cite Base64 Encoder & Decoder

Embed this interactive utility directly into documentation or blog posts, or link via GitHub badge:

Free for Blogs & Docs
HTML Embed Code (iframe):
<iframe src="https://filexshare.com/developer/base64-encoder" width="100%" height="650" frameborder="0" title="Base64 Encoder & Decoder - FileXShare"></iframe>
<p><a href="https://filexshare.com/developer/base64-encoder" rel="nofollow">Powered by FileXShare</a></p>
Markdown / README Badge:
[![Base64 Encoder & Decoder](https://img.shields.io/badge/Mango%20Developer-Base64%20Encoder%20%26%20Decoder-orange?style=flat&logo=code)](https://filexshare.com/developer/base64-encoder)
Inputs stay in browser memory. No external request is required for this operation, and zero data leaves your device.