Decode · Preview · Download

Base64 to File
Converter

Decode any Base64 string back to a downloadable file. Images, PDFs, audio, video, ZIP archives preview in-browser and save instantly. Zero uploads, 100% private.

Base64 Input0 chars
MIME Type: Filename: or auto-detected from data URI
File Preview
📄

File preview will appear here after decoding

20+
File Types
25MB
Max File Size
0ms
Server Latency
100%
Private & Secure

From Base64 to File in Three Steps

No account, no server uploads. Paste, preview, and download in seconds.

1

Paste Base64 String

Copy your Base64 string and paste it in the input. The tool accepts raw Base64 or a full data:mime/type;base64,… data URI the format is auto-detected.

2

Select Type & Preview

Choose the MIME type and filename, or let it auto-detect from the data URI. Click "Decode & Preview" to see images inline, or get a file info card for other types.

3

Download or Copy

Save the file to your device with the correct extension, copy the data URI for use in code, or open the decoded file directly in a new browser tab.

Everything You Need to Recover Files

A complete Base64 file toolkit decode, preview, encode, and build data URIs all in one private tool.

🖼️

Inline Image Preview

PNG, JPEG, GIF, WebP, SVG, and BMP images render directly in the tool so you can verify the file looks correct before saving it to disk.

📁

20+ Supported Formats

Images, PDFs, text files, audio, video, ZIP archives, JSON, CSV, XML if it can be Base64-encoded, this tool can decode and download it.

🔄

Two-Way Conversion

Decode Base64 back to a file and encode any file to Base64. Drag-and-drop any file to generate its Base64 string or complete data URI instantly.

🔗

Data URI Auto-Detection

Paste a full data:…;base64,… URI and the MIME type, filename, and preview are all set automatically no manual configuration needed.

One-Click Download

Download the decoded file with the correct extension (e.g. .png, .pdf, .zip) with a single click no copy-paste into a hex editor required.

🔒

100% Private

All encoding and decoding runs locally in your browser via native Web APIs. Your files never leave your device safe for sensitive documents and proprietary assets.

File Type Reference

MIME types, extensions, and in-browser preview support for all supported file categories.

IconMIME TypeExtensionCategoryIn-Browser Preview
🖼️image/png.pngImage✅ Inline render
🖼️image/jpeg.jpg / .jpegImage✅ Inline render
🎞️image/gif.gifImage✅ Animated render
🖼️image/webp.webpImage✅ Inline render
🎨image/svg+xml.svgImage✅ Vector render
📄application/pdf.pdfDocument📋 File info card
📝text/plain.txtDocument📋 Text preview
🌐text/html.htmlDocument📋 File info card
📊text/csv.csvDocument📋 Text preview
🔧application/json.jsonDocument📋 Text preview
🎵audio/mpeg.mp3Audio🔊 Audio player
🎵audio/wav.wavAudio🔊 Audio player
🎬video/mp4.mp4Video🎬 Video player
📦application/zip.zipArchive📋 File info card
📦application/gzip.gzArchive📋 File info card
💾application/octet-streamanyBinary📋 File info card

When You Need Base64 to File

Base64-encoded files appear in API responses, databases, and config files more often than you'd think.

01

API Response Inspection

Many REST APIs return generated files PDFs, reports, images as Base64 in JSON responses. Decode them instantly to verify the content without writing any code.

02

Email Attachment Recovery

MIME email attachments are Base64-encoded. Extract the encoded payload from a raw email source and decode it here to recover the original file.

03

Database Binary Storage

Applications that store files as Base64 in databases or NoSQL stores (MongoDB, Firestore) can have their content decoded and downloaded directly from this tool.

04

Embedded HTML Assets

Images and fonts embedded as Base64 data URIs in HTML or CSS can be extracted and saved as standalone files for reuse or optimisation.

05

Config & Secret Files

Service account JSON keys, TLS certificates, and SSH keys are often stored as Base64 in CI/CD environment variables. Decode and inspect them safely without a terminal.

06

IoT & Embedded Payloads

IoT platforms and messaging systems like MQTT frequently transmit binary sensor data or firmware as Base64. Decode payloads to inspect the underlying binary content.

How Base64 to File Decoding Works

Base64 encodes every 3 bytes of binary data as 4 printable ASCII characters making the output roughly 33% larger. To recover the original file, the decoder reverses this: every 4 Base64 characters map back to 3 bytes of binary data.

The resulting byte array is wrapped in a Blob with the correct MIME type, then converted to an object URL using URL.createObjectURL(). The browser uses this URL to trigger a file download with the proper extension no server required.

Data URIs combine the MIME type and Base64 payload in a single string (data:mime/type;base64,…). The tool auto-parses this prefix so you can paste a full data URI without manually stripping the header.

// Decode Base64 → downloadable file
 
function b64ToFile(b64, mime, name) {
  // 1. Base64 → raw binary string
  const raw = atob(b64);
 
  // 2. Binary string → byte array
  const bytes = Uint8Array.from(
    raw, c => c.charCodeAt(0)
  );
 
  // 3. Bytes → Blob → object URL
  const blob = new Blob([bytes],{type:mime});
  const url = URL.createObjectURL(blob);
 
  // 4. Trigger download
  const a = document.createElement('a');
  a.href = url; a.download = name;
  a.click();
}

Frequently Asked Questions

Everything you need to know about converting Base64 back to files.

Any file type that was originally Base64-encoded can be decoded images (PNG, JPEG, GIF, WebP, SVG), documents (PDF, TXT, HTML, CSV, JSON), audio (MP3, WAV, OGG), video (MP4, WebM), archives (ZIP, GZIP), and arbitrary binary files. Select the correct MIME type from the dropdown to ensure the file downloads with the right extension.
Raw Base64 is just the encoded binary payload a long string of characters like iVBORw0KGgo…. A data URI wraps that payload with a MIME type prefix: data:image/png;base64,iVBORw0KGgo…. Both formats are accepted by this tool. For data URIs the MIME type is auto-detected, so you don't need to select it manually.
The most likely cause is a mismatched MIME type for example, selecting PNG when the data is actually a PDF. Try switching the MIME type selector. Also ensure the Base64 string is complete and not truncated. If it came from a JSON field, make sure any JSON escaping (like \" or \n) has been removed before pasting.
For the File → Base64 encoder, the limit is 25 MB per file. For pasting raw Base64 text there is no enforced limit, though strings larger than ~50 MB may slow down the browser since the entire payload is held in memory. Base64 is roughly 33% larger than the original binary, so a 25 MB file produces approximately 33 MB of Base64 text.
No. All encoding and decoding uses browser-native APIs atob(), Blob, URL.createObjectURL(), and FileReader. Nothing is transmitted. The tool works completely offline after the initial page load, making it safe to use with sensitive documents like certificates, keys, or confidential reports.
Yes, for supported types. Images (PNG, JPEG, GIF, WebP, SVG, BMP) render inline as a visual preview. Audio files load into an HTML5 player. Video files load into a video player. Text-based files (TXT, JSON, CSV) show a text preview. PDFs, ZIP archives, and other binary formats display a file info card with name, type, and size before you download.
Use the "File → Base64" tab to drag-and-drop or browse for any file the tool generates the Base64 string and full data URI instantly. Alternatively, in JavaScript you can use FileReader.readAsDataURL(), in Python use base64.b64encode(), or in the terminal run base64 -i input.png.
Base64 encodes every 3 bytes of binary data as 4 ASCII characters, resulting in an output approximately 33% larger than the original file. This overhead is the trade-off for being able to represent binary data safely in text-only contexts like JSON payloads, HTML attributes, or email bodies.