Skip to content

Encode or decode Base64 online

Runs in your browser — this file is never uploaded

Base64 turns binary data into plain text safe for places that only accept text — JSON fields, config files, email attachments, API payloads. Add a file to encode it, or a text file holding a base64 string to decode it back.

Encoding produces two downloads: the raw base64 on its own, and a ready-to-use data URI with the format prefix included. Decoding accepts either form — a bare string or a full data URI — and works out which by itself.

Your data never leaves your device. Encoding and decoding both run entirely in your browser, so nothing is uploaded, stored, or scanned.

or drop them here — nothing is uploaded

How to base64 encoder/decoder

  1. Choose encode or decode

    Encoding takes any file and produces base64 text. Decoding takes a .txt file containing base64 (or a data URI) and produces the original file back.

  2. Add your file

    To decode, save the base64 string or data URI into a plain .txt file first, then drop it in.

  3. Run and download

    Press Base64 Encoder/Decoder. Encoding downloads a base64 file and a data URI file; decoding downloads the recovered file.

Frequently asked questions

Is my file uploaded anywhere?

No. Encoding and decoding both run in your browser using JavaScript, so your file stays on your device. You can confirm this by opening your browser devtools Network tab while working — there are no upload requests.

Why does decoding need a .txt file instead of a paste box?

This tool uses the same drag-and-drop file box every tool on the site does, rather than a separate paste box for one direction only — one interaction pattern instead of two. Saving a base64 string into a plain .txt file takes a few seconds and works identically.

How does decoding know what kind of file to produce?

If the text is a data URI (starting `data:type;base64,`), the declared type names the format directly. For a bare base64 string with no such prefix, there's no reliable way to know — the file downloads as generic `decoded.bin` unless you set an output file name yourself, which is exactly what that option is for.

What's the difference between the two encode downloads?

The base64 file is just the encoded data on its own — useful when something else supplies the format declaration itself, like a JSON field. The data URI file wraps that same data with a `data:type;base64,` prefix, ready to paste directly into an HTML `src`, a CSS `url()`, or anywhere else expecting a complete, self-describing value.

The data URI's type looks wrong, or says octet-stream. Why?

There is no reliable way to know a file's real format from its bytes and name alone for every file type, so the guess comes from the file extension against a modest, honest list of common formats — text, JSON, XML, PDF, ZIP, common image formats, and a few others. Anything outside that list falls back to `application/octet-stream` rather than a wrong guess. For images specifically, Image to Base64 covers every format properly, since it detects the format from the actual pixel data.

Is there a size or file-count limit?

Twenty files at a time, and base64 text runs about 33% larger than the original binary — both are limits of your device rather than our policy, since everything is held in memory while it works.

I specifically need to encode or decode an image?

Image to Base64 and Base64 to Image are built for that case and always get the format right.