Encoding / Decoding

Base64 Encode / Decode

Encode or decode text using Base64.

Original text
Base64
Result will appear here

What is Base64 Encoding?

Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters. It's commonly used to transmit binary data over text-based protocols (like HTTP, email), or to embed small data (like images as Data URIs) in URLs and HTML.

Features

  • Two-way conversion: Supports both encoding and decoding
  • Unicode support: Correctly handles UTF-8 encoded characters (including Chinese)
  • Real-time conversion: Results update instantly as you type
  • One-click copy: Quickly copy conversion results

Use Cases

  • Image Data URIs: Convert small images to embeddable Base64 strings
  • API Authentication: HTTP Basic Auth uses Base64 encoded credentials
  • Data Transfer: Transmit binary data within JSON
  • Email Attachments: Standard encoding for email attachments

Frequently Asked Questions

Why does Base64 output end with one or two "=" signs?
That is padding, which rounds the output length up to a multiple of 4. Base64 encodes 3 bytes into 4 characters: 1 leftover byte needs "==", 2 leftover bytes need "=". Padding carries no data, and some URL-safe variants omit it entirely.
Is Base64 a form of encryption?
No. Base64 is a keyless, fully reversible encoding — anyone can decode it. Use it to carry binary data as text, never to protect secrets; for confidentiality use AES or similar.
Why does my Chinese text decode as garbled characters in some tools?
Classic atob/btoa only handle Latin-1 bytes. This tool encodes the UTF-8 bytes of your text, so Chinese, emoji, and other non-ASCII characters round-trip correctly.