Base64 Encoder / Decoder

Encode or decode text, or convert any file or image to and from Base64 — right in your browser.

Runs in your browserNo sign-up required
Plain text
Base64

Text, Files, and Images — Not Just Text

A large share of what people actually need a Base64 tool for involves files, not plain text — embedding an image directly in CSS, encoding a small asset for an API payload, or turning a downloaded file into a portable string. This tool handles the text case and the file case equally well, with a live image preview for image files and a reverse mode that rebuilds a real, downloadable file from a Base64 string.

How to Use This Tool

  1. 1Choose Text or File / Image modeText mode encodes/decodes plain text; File mode handles any uploaded file, with an image preview built in.
  2. 2For text, pick Encode or DecodeType or paste your input and the result updates instantly on the other side.
  3. 3For files, click to choose oneThe file is converted to a Base64 data URI locally — nothing is uploaded to a server.
  4. 4Reconstruct a file from Base64Paste a Base64 string back in and download it as a real file again, with a filename of your choice.

Why File Support Actually Matters

  1. 1Most Base64 tools only handle textA huge share of real Base64 use cases are actually about files — embedding a small image directly into CSS or HTML, encoding an attachment for an API request, or converting a downloaded asset into a portable string. A text-only tool can't help with any of that.
  2. 2This tool converts any file, not just imagesChoose any file — image, PDF, font, small document — and it's converted to a Base64 data URI you can copy directly into code. If the file is an image, a live preview renders immediately so you can visually confirm it decoded correctly.
  3. 3It also works in reversePaste a Base64 string (with or without the data: prefix) and a filename, and this tool reconstructs the original bytes into a real, downloadable file — useful when you have Base64 data from an API response or log and need the actual file back.

Frequently Asked Questions

What is Base64 encoding used for?

Base64 converts binary data into a plain-text, ASCII-safe string, which makes it possible to embed images or files directly inside JSON, HTML, CSS, or a URL — anywhere binary data can't safely go but text can. It's not encryption; anyone can decode it back to the original.

Can I convert an image to Base64 with this tool?

Yes — switch to File / Image mode, choose any image, and it's converted to a Base64 data URI instantly with a live preview shown, so you can copy it directly into an `<img src>` or CSS `background-image` without a separate hosting step.

Can I convert a Base64 string back into a downloadable file?

Yes — paste the Base64 string (or a full data URI) into the "Base64 → File" section, give it a filename, and click Download to reconstruct it into a real file.

Why does encoding a file make the Base64 string larger than the original?

Base64 encoding represents every 3 bytes of binary data as 4 text characters, which inflates the size by roughly 33%. This tradeoff is what makes binary data safely representable as plain text in the first place.

Is my file or text uploaded anywhere when I use this tool?

No — all encoding and decoding happens locally in your browser using the standard FileReader and btoa/atob APIs. Nothing is transmitted to a server, which is safe even for files you wouldn't want to upload to a random website.

Is this Base64 tool free to use?

Yes, completely free, with no sign-up and no file size restriction beyond what your browser can handle.