Base64 to Blob
A Blob is JavaScript's in-memory binary object. To convert Base64 to a Blob, decode it to bytes with atob(), copy them into a Uint8Array, and pass that to new Blob([bytes], { type }). Paste Base64 below to build one and download it, or copy the function. Everything runs in your browser — nothing is uploaded.
How to convert Base64 to a Blob
Paste your data into the box above. You can give it a full data URI — a string of the form data:image/png;base64,iVBORw0… — or just the raw Base64 payload. The tool decodes the bytes locally, sniffs the MIME type from the leading bytes, and builds a real Blob in memory. The line above the button shows the detected size and type. Click Download to save the Blob with a matching extension.
The JavaScript: convert Base64 to a Blob
Here is the canonical, copy-pasteable function. It strips a data-URI prefix if present, decodes with atob(), copies the character codes into a Uint8Array, and hands that to the Blob constructor:
function base64ToBlob(base64, mime = 'application/octet-stream') {
// Strip a data-URI prefix if present
const clean = base64.replace(/^data:[^;,]*;base64,/, '');
const binary = atob(clean);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
return new Blob([bytes], { type: mime });
}
// Usage: turn it into a downloadable object URL
const blob = base64ToBlob(myBase64, 'image/png');
const url = URL.createObjectURL(blob);
There's also a shorter, asynchronous alternative that lets the browser do the decoding for you:
// Simpler, async — lets the browser parse the data URI for you:
const blob = await (await fetch('data:image/png;base64,' + myBase64)).blob();
Tip: pass the right type. A Blob with the correct MIME (e.g. image/png) previews and downloads properly; the default application/octet-stream forces a generic binary download.
Creating a downloadable link
Once you have a Blob, wrap it in an object URL and trigger a download from an anchor element:
const blob = base64ToBlob(myBase64, 'application/pdf');
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'file.pdf';
a.click();
// Free the memory once the download has started
URL.revokeObjectURL(url);
Object URLs stay alive until the page unloads, so always call URL.revokeObjectURL(url) when you're done to avoid leaking memory — especially in single-page apps that create many Blobs.
Is this private?
Yes. The conversion runs fully in the browser with JavaScript — your Base64 is decoded and the Blob is built locally, and nothing is uploaded to any server. You can confirm in DevTools → Network: pasting and downloading fires no request.
Frequently asked questions
How do I convert a Base64 string to a Blob in JavaScript?
Decode the Base64 to a binary string with atob(), copy each character code into a Uint8Array, then pass that array to new Blob([bytes], { type: mime }). Strip any leading data:...;base64, prefix first. The result is an in-memory Blob you can download or turn into an object URL.
How do I download a Blob?
Create an object URL with const url = URL.createObjectURL(blob), set it as the href of an <a download> element, and click it programmatically. Afterward call URL.revokeObjectURL(url) to free the memory. The tool above does exactly this when you click Download.
Why use Uint8Array instead of the string directly?
Passing the Base64 string straight to new Blob([str]) stores the literal Base64 text as bytes, not the decoded binary data — the file would be corrupt. You must decode to real bytes first with atob() and a Uint8Array so the Blob holds the actual PNG, PDF, or other content.
Can I use fetch() to decode Base64?
Yes. A data URI is a valid URL, so const blob = await (await fetch('data:image/png;base64,' + myBase64)).blob() lets the browser parse and decode it in one line. It's the simplest approach when you already have, or can build, a full data URI.
Need plain Base64 encode/decode?
The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.
Open base64.dev →