Base64 Encoder

Loading tool…

About Base64 Encoder

Tabs are Encode and Decode (Encode is the default). Paste text or upload a .txt file. Output updates as you type. Copy the result. There is no Run button and no swap that moves output back into the input.

Encode uses UTF-8 bytes, so cafe and emoji round-trip. URL-safe (- and _) is an encode-only toggle: it uses hyphen and underscore and strips padding. Decode always accepts both alphabets and restores padding when it can be inferred. The toggle is disabled on Decode because it is not needed.

How to use Base64 Encoder

  1. 1Choose Encode or Decode. Encode is the default. The same paste box is used for both.
  2. 2Paste text or upload a .txt file. Upload is 15MB max. For images, use Base64 Image instead.
  3. 3Turn on URL-safe if you need it. Encode only. Uses hyphen and underscore and drops padding.
  4. 4Copy the output. To reverse it, switch tabs and paste the copied string.

Encode vs decode

Switching Encode and Decode keeps the same input box. It does not move the output into the input. To reverse a result, copy it and paste it after you change tabs.

Upload is 15MB max. Paste is not size-capped. Whitespace-only input shows no output. Invalid Base64 shows a short error. This page is for text. Use Base64 Image for files and data URIs.

Limits and privacy

Encoding runs in your browser. Files are not uploaded. Upload is 15MB max. No account.

FAQs

Why not btoa alone?
btoa throws or mangles non-ASCII. This page encodes UTF-8 bytes first so those characters survive.
What does URL-safe change?
On Encode, + becomes hyphen, / becomes underscore, and trailing = is removed. Decode already accepts that alphabet.
Is there a swap button?
No. Copy the output, switch Encode or Decode, and paste.
Can I encode an image here?
Use Base64 Image for files and data URIs. This page is text.
Does decode need padding?
Missing = is restored when the length makes the padding obvious.