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


        

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 here?

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.