Your data is never sent to a server or stored anywhere. All processing happens in your browser.

Base64 Encode / Decode

Samples Click to load a sample
Mode
Output

How to Use


Type or paste text into the input area to instantly encode or decode Base64. Use the toggle to switch between Encode and Decode mode.

What Is Base64


Base64 is a binary-to-text encoding scheme that represents binary data as ASCII characters. It is commonly used to embed images in HTML/CSS, transmit data in JSON or XML, and encode email attachments (MIME).

UTF-8 Support


This tool fully supports UTF-8 encoding. Unlike the native btoa() function which only handles ASCII, this tool uses TextEncoder/TextDecoder to correctly process multibyte characters including Japanese, Chinese, Korean, and emoji.

Use Cases


  • Data URIs: embed small images directly in CSS or HTML as Base64 to reduce HTTP requests (e.g., background-image: url(data:image/png;base64,...))
  • API payloads: include binary data such as images or files in JSON when calling REST APIs
  • Email attachments: MIME-encoded emails use Base64 for file attachments — decode to inspect contents
  • JWT inspection: JWT payloads are Base64url-encoded — decode to view the claims without a library

Limitations


Base64 encoding increases data size by approximately 33%, because every 3 bytes of binary data become 4 ASCII characters. Keep this overhead in mind when embedding large files. Also, Base64 is encoding, not encryption. Anyone can decode it instantly, so never rely on Base64 alone to protect sensitive data — use proper encryption instead.

Privacy


All encoding and decoding happens entirely in your browser. Your data is never sent to a server, stored, or logged. You can safely encode sensitive content such as API keys or tokens.