Base64 Encode / Decode

Convert any text to Base64 and back — with proper UTF-8 handling, so emoji and accented characters survive the round trip. Encoding and decoding are one click each, all offline in your browser.

How it works

Type or paste text, hit Encode to get Base64, or paste Base64 and hit Decode to get text back. The tool encodes the UTF-8 bytes (not raw 16-bit units), which is why non-ASCII text decodes correctly elsewhere.

Formula and source

Base64 maps each 3 input bytes to 4 alphabet characters (A–Z, a–z, 0–9, +, /) with = padding, per RFC 4648, https://www.rfc-editor.org/rfc/rfc4648 — last verified 2026-10-09.

Worked examples

  • Encode "Hello, tools!" ? SGVsbG8sIHRvb2xzIQ==
  • Encode "Ma" and "?" ? "Ma" ? TWE=, "?" ? 4pyT (UTF-8 bytes, not chars)

Common mistakes

  • Encoding JavaScript UTF-16 code units directly (classic btoa pitfall) — multibyte characters corrupt.
  • Forgetting = padding when hand-editing encoded strings.
  • Using standard Base64 inside URLs: + / and = need the URL-safe variant there.

Tips

  • For files instead of text, use File to Base64.
  • Base64 grows data by ~33{d22ed4253049e3f8ac8a2476ba66be74662354cd56801a0460dd56fc19902ca9} — it is an encoding, not compression or encryption.

FAQ

What is Base64 used for?

Embedding binary data (images, files, tokens) inside text formats like JSON, HTML and data URIs.

Why do emojis break in some Base64 tools?

Naive encoders feed UTF-16 units to btoa; this tool encodes UTF-8 bytes, so emoji round-trip cleanly.

Is Base64 encryption?

No u2014 it is trivially reversible encoding with zero secrecy.

Base64 vs Base64URL?

URL-safe Base64 swaps +/ for -_ and drops padding for use in links and tokens.

Is the Base64 encoder free?

Yes, completely free with no signup.

Is my text uploaded anywhere?

No. Encoding runs entirely in your browser.

Related tools