File Base64: Encode to Text and Decode Back

Open Tool File Base64

The ticket for binary entering text channels

Base64 maps bytes to text using only sixty-four safe characters so files fit inside JSON, XML, mail bodies or plain text fields. The tool works both ways: encoding a chosen file shows the result in the output box where it can be copied; decoding converts pasted Base64 back into a downloadable file, with controls for encoding, sample and clear. The input hint accepts either a chosen file or pasted Base64, and both directions share one text area.

Steps

  1. For encoding, choose the file or press the encode control directly.
  2. Read the result and copy the plain Base64 text.
  3. Ensure no line breaks or stray characters remain, since some interfaces reject wrapped output.
  4. For decoding, paste Base64 into the input and run the decode control.
  5. Download the restored file and confirm name and extension.
  6. Clear to avoid leftover results.

Size, alphabet, line breaks

Base64 inflates: every three bytes become four characters, adding about a third, so a four megabyte file encodes to nearly five and a half. The alphabet runs A to Z, a to z, zero to nine plus two symbols, standard as plus and slash, with URL-safe variants using hyphen and underscore. Many implementations insert breaks every seventy-six characters, correct for mail but surplus whitespace in JSON. Decoding failures usually come from embedded spaces or breaks, or a plus sign turned into a space. Base64 is not encryption, since anyone can reverse it, and it never compresses, only growing the payload.

Common mistakes

Treating Base64 as encryption and assuming safety. Pasting wrapped output into JSON and breaking the parse. Losing a plus sign to a space during transfer. Omitting trailing equals signs and breaking padding. Skipping extension checks after decoding. And expecting compressed transfer while size doubled.

Where Base64 is the wrong container

Shrinking size needs compression. Protecting content needs encryption. Binary transfer needs uploads rather than text channels. And long-term storage pays a third extra space forever.

⏫︎