Decode a Base64 string to a downloadable file. Auto-detects format from content signature. Works with images, PDFs, audio, and any binary file. Client-side.
Paste a Base64 encoded string to decode it into a downloadable file. This tool auto detects the file format from content signatures and works with images, PDFs, audio, archives, and any binary data. The entire process runs in your browser.
This tool identifies files by their magic bytes, the signature bytes that begin every file of a particular type:
| Signature | Base64 prefix | Detected as |
|---|---|---|
\x89PNG\r\n\x1a\n |
iVBOR |
PNG image |
\xFF\xD8\xFF |
/9j/ |
JPEG image |
GIF89a or GIF87a |
R0lGOD |
GIF image |
RIFF....WEBP |
UklGR |
WebP image |
<svg |
PHN2Zy |
SVG image |
%PDF |
JVBERi |
PDF document |
PK\x03\x04 |
UEsDB |
ZIP archive |
ID3 |
SUQz |
MP3 audio |
If a data URI is provided, the MIME type from the URI takes precedence. For unrecognized signatures, the file is saved with a .bin extension.
Many web APIs return binary data as Base64 strings in JSON:
{
"result": "UEsDBBQAAAAIAM1Y...",
"type": "application/zip"
}
AI APIs (image generation, text to speech), document generation services, and chart rendering APIs commonly use this pattern.
When applications store binary files as text in databases, exported records contain Base64 encoded data that needs to be decoded to recover the original files.
Kubernetes secrets, CI/CD pipelines, and cloud configuration store binary data (TLS certificates, private keys, license files) as Base64:
apiVersion: v1
kind: Secret
data:
tls.crt: LS0tLS1CRUdJTi...
tls.key: LS0tLS1CRUdJTi...
MIME encoded email attachments appear as Base64 blocks in raw email source, between boundary markers.
function base64ToFile(base64, filename) {
const binary = atob(base64);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) {
bytes[i] = binary.charCodeAt(i);
}
return new File([bytes], filename);
}
const fs = require('fs');
const buffer = Buffer.from(base64String, 'base64');
fs.writeFileSync('output.bin', buffer);
import base64
data = base64.b64decode(base64_string)
with open('output.bin', 'wb') as f:
f.write(data)
data, err := base64.StdEncoding.DecodeString(base64String)
os.WriteFile("output.bin", data, 0644)
base64 -d < encoded.txt > output.bin # Linux
base64 -D < encoded.txt > output.bin # macOS
Data URIs include the MIME type before the Base64 content:
data:application/pdf;base64,JVBERi0xLjQK...
This tool handles both formats. If you paste a data URI, it strips the prefix and uses the declared MIME type. If you paste raw Base64, it detects the type from the content signature.
To strip the prefix programmatically:
const base64 = dataUri.split(',')[1];
const mimeType = dataUri.match(/data:([^;]+)/)[1];
Browser based Base64 decoding works reliably for files up to tens of megabytes. This tool caps input at 50 MB to prevent memory issues. The decoded file size is approximately 75% of the Base64 string length (the inverse of the 33% encoding overhead).
For type specific tools, see Base64 to Image and Base64 to PDF. For the reverse operation, see File to Base64 or the general Image to Base64 converter.
Nothing you paste leaves this tab. Every tool runs entirely in your browser — no upload, no server, no account.