Base64 Encoder & Decoder

Convert text or files to Base64, decode Base64 back to readable text, and optionally generate the URL-safe variant β€” instantly, in your browser.

How to Encode or Decode Base64

  1. Choose "Encode Text", "Decode Text", or "Encode File" using the pill toggle at the top of the tool.
  2. In text modes, paste your text (to encode) or your Base64 string (to decode) into the input box; in file mode, click or drag a file into the upload area.
  3. Optionally check "URL-safe output" to swap + and / for - and _ in the encoded result β€” handy for putting Base64 inside a URL or filename.
  4. Text modes need the action button clicked; file mode encodes automatically the moment you drop or pick a file.
  5. Click "Copy Result" to copy the output, or "Clear" to reset the tool.

Frequently Asked Questions

Is Base64 encryption?

No β€” Base64 is a reversible encoding, not encryption. Anyone can decode it back to the original text with this same tool or any other Base64 decoder, so it should never be used to hide sensitive data.

Why does decoding sometimes fail with "doesn't look like valid Base64"?

The decoder calls the browser's atob() function, which throws an error on strings that aren't valid Base64, such as wrong characters or incorrect padding. The tool catches that error and shows the message instead of leaving the result blank.

Does it handle Unicode text correctly, not just plain ASCII?

Yes β€” before encoding, the tool runs your text through TextEncoder to convert it to UTF-8 bytes first, so emoji and non-English characters encode and decode correctly instead of getting mangled the way a plain btoa(text) call would.

What actually happens when I click Encode?

Your text is converted to UTF-8 bytes, those bytes are mapped to a binary string, and that binary string is passed to the browser's native btoa() function, which produces the standard Base64 output.

Can I convert files, not just text?

Yes β€” switch to the "Encode File" mode and drop in any file. It's read with the browser's FileReader API and converted to a Base64 string entirely on your device; nothing is uploaded anywhere, and there's no practical file-type restriction since Base64 just encodes raw bytes.

What is URL-safe Base64 and when do I need it?

Standard Base64 uses + and / characters, which have special meaning inside URLs and filenames and must be percent-encoded there. URL-safe Base64 (also called base64url) simply swaps + for - and / for _, so the result can be dropped directly into a URL, query string, or filename without extra escaping. Check the "URL-safe" box when encoding to get this variant; decoding automatically accepts either form.