Base64 encoder / decoder

Encode text to Base64 or decode Base64 to UTF-8 text in one tool. Accepts URL-safe Base64 and ignores line breaks when decoding. Runs locally in your browser.

Processed locally in your browser
Loading tool…

About Base64 encoder / decoder

The Base64 encoder and decoder switches between plain text and Base64 with a single toggle. Text is encoded as UTF-8 bytes first, so accented letters, non-Latin scripts and emoji round-trip correctly, which the browser’s btoa function cannot do on its own.

Decoding is forgiving where it can be: spaces and line breaks are ignored, and URL-safe Base64 using - and _ is accepted alongside the standard + and / alphabet. The decoded bytes must form valid UTF-8 text, so the tool is meant for strings such as credentials, headers and config values rather than binary files.

How to use Base64 encoder / decoder

  1. Choose Encode or Decode.
  2. Paste text or a Base64 string into the input box, or open or drop a text file.
  3. Read the result in the output box; it updates as you type.
  4. Copy the result or download it as a .txt file.

Features

  • Encodes text as UTF-8 into standard Base64, using + and / with = padding.
  • Decodes standard and URL-safe Base64, ignoring spaces and line breaks.
  • Rejects decoded data that is not valid UTF-8 text instead of showing garbled characters.
  • Shows a clear error when the input contains characters that are not Base64.
  • Handles inputs up to 2 MB.

Common uses

  • Building or reading the value of an HTTP Basic Authorization header.
  • Decoding values in Kubernetes Secrets or other Base64-encoded config fields.
  • Inspecting Base64 strings found in logs, emails or API responses.
  • Encoding text for an environment variable or field that cannot hold line breaks or special characters.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding that represents bytes using 64 printable characters. Anyone can decode it without a key, so it offers no confidentiality. Use it to carry data through text-only channels, not to protect secrets.

Why is Base64 output about a third larger than the input?

Base64 represents every 3 bytes with 4 characters, so encoded data is roughly 33% larger, plus up to two = padding characters. Text with non-ASCII characters grows more relative to its character count, because those characters take 2 to 4 bytes each in UTF-8.

What is URL-safe Base64?

A variant defined in RFC 4648 that replaces + with - and / with _, so the result can appear in URLs and file names without escaping. JSON Web Tokens use it. This tool decodes both variants, while encoding produces standard Base64 with + and /.

Can I decode a Base64 image or file here?

Only if the decoded bytes are UTF-8 text. Images, PDFs and other binary data are rejected with “The input does not contain valid UTF-8 text.” Use the Base64 to image tool to turn a Base64 image back into a file.

Why do I get “This isn’t valid Base64”?

The input contains a character outside the Base64 alphabet, such as a quote, comma or %, or its length cannot form complete Base64. Check that you copied the whole value, and remove any data: URI prefix such as data:text/plain;base64, before decoding.

Is my input uploaded?

Tools run in your browser. Files, text and results are not uploaded to our servers and are cleared when you leave the tool.

Your privacy comes first

Tools run in your browser. Files, text and results are not uploaded to our servers and are cleared when you leave the tool.

Find your next tool
↑ ↓ · Enter ↵Esc · Close search