CalcCanvas

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 strings back to plain text. Everything runs locally in your browser.

How to Use

  1. Type or paste text into the input area.
  2. Click Encode to convert plain text to Base64.
  3. Click Decode to convert a Base64 string back to plain text.
  4. Use the Copy button to copy the result to your clipboard.
  5. Click Clear to reset both fields.

About This Tool

Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It is commonly used for embedding images in HTML/CSS, encoding email attachments, transmitting data in URLs, and storing complex data in JSON. This tool supports full Unicode text through UTF-8 encoding.

What Is Base64 Encoding?

Base64 is a way of representing binary data using only printable ASCII characters. It takes any sequence of bytes and converts it into a string made up of letters (A-Z, a-z), digits (0-9), plus signs (+), and forward slashes (/). The result is always about 33% larger than the original data, but it can safely travel through systems that only handle text.

The encoding works by taking groups of three bytes (24 bits) and splitting them into four 6-bit chunks. Each chunk maps to one of the 64 characters in the Base64 alphabet. If the input length isn't divisible by three, padding characters (=) are added at the end.

Base64 is not encryption. It doesn't provide any security — anyone can decode a Base64 string. Its purpose is purely about safe data transport, not confidentiality.

Frequently Asked Questions

Why would I use Base64 instead of sending raw data?

Many protocols and formats (like email, JSON, and HTML) are designed to handle text, not raw binary. Base64 lets you embed binary content — such as images or file attachments — within these text-based formats without corrupting the data.

Is Base64 the same as encryption?

No. Base64 is an encoding scheme, not an encryption method. Anyone with access to the encoded string can decode it instantly. If you need to protect sensitive data, use proper encryption algorithms like AES or RSA instead.

Why is the Base64 output longer than my input?

Base64 represents every 3 bytes of input as 4 characters of output. This means the encoded string is approximately 33% larger than the original. The trade-off is worth it when you need to embed binary data in a text-only context.

Does this tool support Unicode text?

Yes. This tool handles full Unicode by first encoding the text as UTF-8 before applying Base64 encoding. This means you can safely encode and decode text in any language, including emoji and special characters.

Common Use Cases

  • Data URIs in CSS/HTML — Embed small images directly in stylesheets or HTML using data:image/png;base64,... to reduce HTTP requests.
  • Email attachments (MIME) — Email protocols use Base64 to encode file attachments within the message body.
  • API authentication — HTTP Basic Authentication encodes the username and password as a Base64 string in the Authorization header.
  • Storing binary in JSON — Since JSON doesn't support binary data natively, Base64 is the standard way to include files or images in JSON payloads.
  • JWT tokens — JSON Web Tokens use Base64url encoding (a URL-safe variant) for the header and payload sections.

Related Tools