Base64 Encode/Decode

Text, files and images to and from Base64

UTF-8 safe. Nothing leaves your browser.

How to encode or decode Base64

  1. Choose a tab: Text for strings, File → Base64 to turn any file or image into Base64, or Base64 → File to turn Base64 back into a downloadable file.
  2. For text, type or paste your input and press Encode or Decode. Tick URL-safe to use - and _ with no padding, as used in JWTs and URLs.
  3. For files, drop the file on the box. You get the Base64 string, a ready-made data URI, and copy buttons for an HTML <img> tag or a CSS url().
  4. To decode a file, paste the Base64 or data URI. The tool detects the file type from its first bytes, shows a preview for images and lets you download it.

What is Base64?

Base64 is a way of writing binary data using only 64 safe text characters (A–Z, a–z, 0–9, + and /). It is used wherever binary data has to travel through a text-only channel: email attachments (MIME), data URIs in HTML and CSS, JSON APIs, HTTP Basic authentication headers and JSON Web Tokens. Every 3 bytes become 4 characters, so Base64 output is about 33% larger than the original.

Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.

This encoder handles Unicode correctly: text is converted to UTF-8 bytes before encoding, so emoji and accented letters round-trip without the garbled output that plain btoa() produces.

Privacy

All encoding and decoding happens in your browser with built-in JavaScript functions. Files are read locally and are never uploaded, so it is safe to use with private documents, keys and images.

Why is my decoded Base64 unreadable?

The data is probably binary (an image, PDF or compressed file) rather than text. Switch to the Base64 → File tab, which detects the file type and lets you download or preview it.

What is URL-safe Base64?

A variant (RFC 4648 §5) that replaces + with - and / with _ and usually drops the = padding, so the result can be put in URLs and filenames without escaping. The decoder here accepts both variants.

Should I inline images as Base64 data URIs?

Only for small images such as icons under a few kilobytes. Base64 adds a third to the size and cannot be cached separately, so large images are better served as normal files.

Is there a size limit?

Files up to 50 MB are accepted. Everything runs in memory on your device, so very large files depend on your browser's available memory.

Made by BufferMint. We also design and build software products for founders. See our services →

Your files and inputs never leave your device; we only count anonymous visits.