No Uploads · 100% Secure

Base64 Converter
All Files Supported · Instant Processing

Decode Base64 back to a file, or encode any file to Base64.

Works with images, PDFs, Excel files, audio, fonts, and more. Everything runs locally in your browser, so nothing is uploaded to a server.

Drop files here

Image Audio Video PDF Font Text
Files never leave your device. Conversion happens in your browser.
Reading file...
{{ categoryLabel }}

Preview not available for this file type

{{ encodeResult.name }}

Output Code {{ formatBytes(encodeResult.size) }} (Original Size)
For SVG, URL encoding often yields smaller file sizes than Base64.

Accepts a data URI or a plain Base64 string. Line breaks and spaces are removed automatically, and URL-safe Base64 (- and _) works too. The file type comes from the data URI, or is detected from the file's first bytes.

{{ getCategoryLabel(decodeResult.category) }}

Preview not available for this file type

Decode Successful
Type: {{ decodeResult.type }} ({{ decodeResult.source }}) / Size: {{ formatBytes(decodeResult.size) }}
Save File
{{ decodeResult.note }}
{{ decodeError }}

Base64 Converter & Decoder
For Modern Web Development

The Role of Base64 in Web Development

Efficiency in asset management is a priority for modern web development. Embedding small assets like icons and logos directly into HTML or CSS as Base64 strings is a common technique to reduce HTTP requests and accelerate rendering ("critical rendering path").

This tool processes everything locally in your browser, ensuring zero server upload time, maximum privacy, and instant results.

Supported File Formats

Category Formats Output Options
Image PNG, JPG, GIF, WebP, SVG, ICO, BMP <img>, CSS background, Raw
Audio MP3, WAV, OGG, M4A, FLAC <audio>, Raw
Video MP4, WebM, OGV <video>, Raw
PDF PDF <embed>, <iframe>, <object>, Raw
Font WOFF, WOFF2, TTF, OTF, EOT CSS @font-face, Raw
Office/Docs Excel (XLSX, XLS), Word (DOCX, DOC), PowerPoint (PPTX, PPT) Raw (Data URI), JSON
Text/Other JSON, XML, TXT, CSV, ZIP, RAR, GZ, etc. Raw, JSON

Practical Implementation Guide

How to use converted Base64 code in your projects:

1. Embed images directly in HTML

Perfect for small logos or UI elements. Eliminates the network request normally required to fetch the image.

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." alt="Logo">

2. Use as CSS Background Image

Keep your CSS self-contained by embedding background patterns or icons directly.

.icon-check { width: 20px; height: 20px; background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0i..."); background-repeat: no-repeat; }

3. Embed Web Fonts

Prevent "Flash of Unstyled Text" (FOUT) by embedding critical fonts (like WOFF2) directly in your CSS.

@font-face { font-family: 'MyCustomFont'; src: url('data:font/woff2;base64,d09GMgABAAAA...') format('woff2'); font-weight: normal; font-style: normal; }

4. Embed PDF or Audio

Instantly preview documents or play sounds without external dependencies.

<embed src="data:application/pdf;base64,JVBERi0xLjQK..." type="application/pdf" width="100%" height="500px" />

Performance vs. Convenience

Base64 encoding increases file size by approximately 33%. While it reduces HTTP requests, it increases the total payload size. Use it wisely.

✅ Recommended Use Cases

  • Small images (< 10KB) (Icons, markers) - to reduce TCP handshake overhead.
  • Critical Web Fonts - to prevent rendering blocking.
  • HTML Emails - ensures images load even if external images are blocked.
  • Offline Apps - removes dependencies on external servers.

⚠️ When NOT to use Base64

  • Large Photos - Browser caching is more effective for standard files.
  • Frequently Updated Images - Changing the image requires re-downloading the entire CSS/HTML.
  • SEO-Critical Main Images - Standard <img src="..."> tags are generally better for SEO indexing.

FAQ

Does Base64 increase file size?

Yes. Binary data is converted to ASCII characters, resulting in a ~33% size increase. However, if your server uses Gzip or Brotli compression, the transfer size difference is often negligible.

Does image quality degrade?

No. Base64 is a lossless encoding. The data is simply represented differently; decoding it yields the exact original binary file bit-for-bit.

Can I convert Excel or PDF?

Absolutely. Any file can be encoded and decoded, including Excel (.xlsx), Word (.docx), PDF, video, and audio. When decoding, the tool uses the type in the data URI if there is one; otherwise it detects the format from the file's leading bytes (its "magic number") and even looks inside ZIP containers to tell .xlsx, .docx, and .pptx apart.

What if the file type can't be detected?

The data is saved as a generic binary file (.bin). The bytes still match the original exactly, so if you know the format, just change the extension in the "File name" box before saving. Legacy Office files (.doc / .xls / .ppt) share one container format, so the tool doesn't guess which one it is.

Can it decode Base64 with line breaks or URL-safe Base64?

Yes. Base64 wrapped every 76 characters (common in email/MIME) is cleaned up automatically, and URL-safe Base64 (Base64URL, using - and _) and strings without trailing = padding are supported. If the input contains a character that isn't valid Base64, the tool tells you which one.

All formats supported. Try it now without registration.

Convert Now