How to use the Base64 encoder and decoder

  1. Choose Encode or Decode.
  2. Type or paste text, or choose a file to encode. The result updates as you type.
  3. For encoding, choose URL-safe output, padding and MIME line wrapping as needed.
  4. Copy or download the result. Decoded binary files, such as images, can be downloaded directly.

What is Base64?

Base64 represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /), so it can travel through systems that only handle text: JSON, XML, email, HTTP headers and data URLs. Every 3 bytes become 4 characters, so encoded data is about a third larger. Base64 is an encoding, not encryption: anyone can decode it.

Text is encoded as UTF-8, the encoding used by the web and by .NET's Encoding.UTF8, so accented letters and emoji round-trip correctly.

Base64 or base64url?

base64url replaces + and / with - and _, which are safe in URLs and file names, and usually omits the = padding. JSON Web Tokens use base64url. The decoder accepts both alphabets, with or without padding, and ignores line breaks.

Base64 in C#

string encoded = Convert.ToBase64String(Encoding.UTF8.GetBytes("Hello"));
string decoded = Encoding.UTF8.GetString(Convert.FromBase64String(encoded));

// base64url (.NET 9 and later)
string urlSafe = System.Buffers.Text.Base64Url.EncodeToString(bytes);

Frequently asked questions

Are my text and files uploaded?

No. Encoding and decoding happen entirely in your browser, including for files; nothing is sent to our servers or logged.

Why does decoding show "binary data" instead of text?

The decoded bytes aren't valid UTF-8 text: the Base64 contains something like an image, a PDF or compressed data. The decoder recognizes common formats and lets you download the file.

Why is my Base64 rejected?

The decoder points to the first problem: a character outside the Base64 alphabet, padding in the middle of the data, or a length that suggests part of the data is missing.