All Tools View Categories About Contact Privacy

Base64 Encoder / Decoder

Encode or decode Base64 with full UTF-8 (unicode) support. Choose standard or URL-safe alphabet, optional padding and MIME line wrapping. Live output, stats and download.

Text input
Options
Base64 output
Live stats
Notes

About Base64 Encoder / Decoder

Base64 turns bytes into safe ASCII so data can cross text-only borders - email, headers, JSON, data URIs. The trick is that it must handle the bytes underneath correctly, not just the happy path.

Base64 Encoder / Decoder is unicode-safe, gives you the URL-safe alphabet, optional padding, MIME line wrapping and live stats.

Features

  • UTF-8 safe: Emoji, accents, CJK round-trip exactly.
  • Two alphabets: Standard and URL-safe (base64url).
  • Padding control: Keep or strip = padding.
  • MIME wrap: 76-character lines on or off.
  • Live stats: Input bytes, output length, ratio.
  • File encode: Encode a text file as a string.
  • Export: Copy or download the output.

How to Use

  1. Choose Encode or Decode with the mode switch.
  2. Enter or paste text (or load a text file).
  3. Set alphabet, padding and wrap options.
  4. Read the output and the live stats.
  5. Copy or download the result.

Examples

Example 1 - encode. Hello World encodes to SGVsbG8gV29ybGQ= with standard Base64 and padding.

Example 2 - unicode. The emoji 👍 round-trips through UTF-8 Base64 without corruption - a naive encoder would mangle it.

Example 3 - URL. A JWT payload is Base64url without padding; switch alphabets to copy tokens exactly.

Benefits

  • Unicode correct: Real UTF-8 handling.
  • Format aware: url-safe, padding, MIME.
  • Instant: Output updates while you type.
  • Private: Nothing leaves the browser.

Frequently Asked Questions

What is Base64?
A way to represent arbitrary binary bytes using 64 safe ASCII characters (A-Z, a-z, 0-9, +, /). It exists so data - text, images, tokens - can travel through systems that only handle plain text.
Why does Base64 make text longer?
Every 3 input bytes become 4 output characters, so output grows by about 33% (plus padding). That is the tax for encoding 256 byte values into just 64 printable ones.
What is the URL-safe alphabet?
Standard Base64 uses + and /, which are not URL-friendly. Base64url swaps them for - and _, and often drops padding, so the result sits cleanly in a URL, header or filename.
Does it handle unicode and emoji?
Yes. The tool encodes text as UTF-8 bytes before Base64, so emoji, accents and CJK characters round-trip exactly. A naive btoa() would corrupt them - this one does not.
What is MIME line wrapping?
MIME email breaks Base64 into 76-character lines with CRLF. Toggle the wrap option to mirror that format, or leave it off for a single unbroken string (JWT-style).
Is my data sent anywhere?
No. Everything runs in your browser; nothing is uploaded, saved or logged.