Base64 Switch

Encode and decode text, JSON or small files as Base64. Your data never leaves your browser.

100% client-side

Input

0 characters

Output


        
—

What is Base64?

Base64 is a way of representing binary data — files, images, raw bytes — using only plain text characters, so it can safely travel through systems that only understand text, like JSON, URLs or email. It doesn't compress or encrypt anything; it just re-packages the same data into a text-safe form, which is why decoding it gives you back exactly what you started with. This tool lets you go from text/file to Base64 (encode) or from Base64 back to text/file (decode).

How to use Base64 Switch

  1. Pick Encode or Decode at the top of the Input panel.
  2. Type or paste your content into Input, or use Paste, Upload file, or Example.
  3. Read the converted result in the Output panel.
  4. Click Copy to copy it, or Download to save it as a file.

How Base64 encoding works

Base64 represents binary data (bytes) using only 64 printable characters (A-Z, a-z, 0-9, + and /), grouping every 3 input bytes into 4 output characters. It's the standard format for embedding images in CSS, attaching files in JSON, or carrying binary data through text-only contexts:

// Encode
"Hello, DeveloTools!" → "SGVsbG8sIERldk1hdHJpeCE="

// Decode
"SGVsbG8sIERldk1hdHJpeCE=" → "Hello, DeveloTools!"

This tool uses the browser's native TextEncoder/TextDecoder and btoa/atob to make sure text with accents and emoji (UTF-8) encodes and decodes without corruption — no external libraries, no server calls.

Frequently asked questions

Is it safe to upload a file to this Base64 converter?

Yes. The file is read with the browser's File API and never sent to a server — all encoding happens locally on your machine.

What's the difference between standard Base64 and Base64URL?

Base64URL replaces the '+' and '/' characters with '-' and '_' so the result is URL-safe; this tool accepts both variants when decoding.

Can I decode Base64 that represents a binary file, not text?

Yes. If the result isn't valid UTF-8 text, the tool detects that and lets you download the original bytes instead of showing broken text on screen.

How much bigger does Base64 make the data?

About 33% larger than the original, because every 3 input bytes are represented with 4 output characters.