Base64 Encoder / Decoder

Encode or decode Base64 text, and convert files and images to and from Base64 data-URIs. Everything runs locally in your browser.

Paste text or drop a file → choose encode or decode → copy the result instantly.

Paste text or drop a file to encode or decode — everything runs locally in your browser and no data is uploaded.

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption — it's fully reversible by anyone. Never use it to protect passwords or sensitive data; use it only to make binary data text-safe.

What is URL-safe Base64?

Standard Base64 uses + and / which have special meaning in URLs. URL-safe mode replaces them with - and _ and removes = padding, so the string can be used directly in URLs and filenames.

Are my files uploaded?

No. Files are read locally with the browser's FileReader and encoded on your device. Nothing is sent to any server, so it's safe for private files.

Can I decode a data-URI back into an image?

Yes. Paste a data: URI (or raw Base64) into the decode box and the tool reconstructs the file, previews it if it's an image, and gives you a download link.

About Base64

Understanding your results

Encoding turns your input into a longer string of letters, digits and a few symbols — Base64 is always about a third larger than the original, which is the cost of using only safe characters.

TEXT (3 characters) M a n 24 BITS (3 bytes of 8) 01001101 01100001 01101110 regrouped into 4×6 bits → BASE64 (4 characters) T W F u 3 bytes in → 4 characters out — that's the ~33% size increase.
"Man" (3 bytes) becomes "TWFu" (4 Base64 characters). Every 3 bytes map to 4 safe characters, which is why Base64 output is about a third larger.

Decoding reverses it back to the original text or file. If a string won't decode, it usually isn't valid Base64 — check for missing padding or stray characters.

Is Base64 a form of encryption?

No. It's reversible encoding with no secrecy at all. Never use it to protect sensitive data.

Why is my encoded string bigger than the original?

Base64 uses about 4 characters for every 3 bytes, so output is roughly 33% larger. That's normal.

Can I encode a file, not just text?

Yes — you can convert a file to a Base64 data URI for embedding.

What encoding means

Base64 is a way of writing binary data using only 64 plain text characters (A-Z, a-z, 0-9, and two extras). It exists so that binary content can travel safely through systems that only expect text, like email bodies or URLs. It is a representation, not a lock.

Base64 is not encryption

This is the single most important thing to know: Base64 is trivially reversible and provides no security whatsoever. Anyone can decode it instantly. Never treat Base64 as a way to hide passwords or sensitive data.

Why encoded data grows by about a third

Base64 takes 3 bytes of input and represents them with 4 output characters. That 4:3 ratio is why encoded data is roughly 33% larger than the original. When the input length isn't a multiple of 3, the output is padded with one or two "=" characters to fill the last group.

Common uses

Base64 shows up in data URIs (embedding a small image directly in HTML or CSS), in email attachments, and in tokens. It's a transport convenience, chosen for compatibility rather than compactness.

Why binary data needed a text disguise

Older communication systems were often designed around text and could not safely carry arbitrary binary bytes. Base64 maps binary data into a restricted text alphabet, making files and other binary values easier to carry through text-oriented systems.

The 3-byte to 4-character trade-off

Base64 groups 24 input bits---three bytes---and represents them as four 6-bit values. That is why Base64 representation is typically about one-third larger than the original binary data. It is encoding, not encryption.