Paste a Base64 string or data URI, from an API response, a CSS file or HTML, and download the original image with the correct file type.
No limits or paywall.
Use instantly, no account.
Processed inside your browser.
Clean, full-quality output.
No upload queue or waiting.
Works on phone and desktop.
Base64 images turn up everywhere developers look: API responses, database exports, CSS files, HTML emails, browser storage and log files. To check what the image actually is, or to save it as a file, you need to decode it, and to know which file type it is.
This free decoder accepts raw Base64 and data URIs in all the shapes people copy them in, decodes them in your browser, identifies the real file type from the decoded bytes, shows a preview and lets you download the original file. Nothing is uploaded.
Before
Base64 text
iVBORw0KGgo…
A long string copied from an API response or a stylesheet, with no file name or type.
After
image.png
Identical file
Type detected from the decoded bytes, previewed, and saved with the right extension.
Base64 is an exact encoding: in our tests the downloaded file was identical to the original image.
Paste the Base64 string or data URI into the decoder above. Line breaks, quotes, url() and src="…" wrappers are fine.
Press Extract File & Preview. The decoder identifies the file type from the data and shows a preview.
Press the download button to save the file with the right extension, for example image.png.
| You paste | Example | Works? |
|---|---|---|
| Raw Base64 | iVBORw0KGgoAAAANSUhEUg… | Yes, type detected from the bytes |
| Data URI | data:image/png;base64,iVBOR… | Yes, extra parameters (charset) too |
| CSS rule | background-image: url("data:…"); | Yes |
| HTML tag | <img src="data:image/webp;base64,…"> | Yes |
| URL-safe Base64 | uses - and _ , no = padding | Yes |
| Plain SVG data URI | data:image/svg+xml,%3Csvg… | Yes (not Base64 but supported) |
Base64 encodes every 3 bytes as 4 characters. Decoding reverses that exactly: the text becomes the original bytes again. Nothing is recompressed, so the downloaded file is identical to the one that was encoded; we verified this byte for byte.
The harder part is knowing what the bytes are. Data URIs declare a type, but raw Base64 does not, and declared types are sometimes wrong. The decoder checks the file signature (the "magic number" at the start of every file): PNG files start with 89 50 4E 47, which is why PNG Base64 always begins with iVBORw0KGgo, JPEGs with FF D8 FF, and so on.
Base64 rarely arrives clean. The decoder handles the common cases automatically:
url("…") and whole background-image rules, and HTML src="…" attributes are removed.data:image/png;charset=utf-8;base64,… are accepted.- and _ variant used in URLs and JWTs, with or without = padding.data:image/svg+xml,%3Csvg… is percent-encoded rather than Base64, and is decoded too.Images: PNG, JPG, GIF, WebP, BMP, ICO, TIFF, AVIF, HEIC and SVG. Other files: PDF, ZIP, JSON and text. Images your browser can display are previewed; HEIC and TIFF are decoded and downloadable but browsers cannot show them, so convert them afterwards if you need a viewable image. Anything unrecognised is saved as .bin with its declared type.
If the text contains characters that cannot appear in Base64, or its length shows that part of it is missing, the decoder says so and does not offer a broken download. Truncation is the most common problem: logs, terminals and some editors cut long lines, so copy the value from the original source when possible. If a declared type disagrees with the bytes, the file is saved with the correct extension and the mismatch is explained.
Developers use the decoder to inspect images returned by APIs, recover icons embedded in CSS, check thumbnails stored in databases, debug HTML emails and extract attachments from JSON payloads. For the reverse direction, Image to Base64 creates the encoded text.
Decoding runs entirely in your browser. Data from internal systems, customer records or private APIs never leaves your device, and nothing is stored after you close the tab.
Base64 images are often hiding in plain sight. In the browser's developer tools, the Elements panel shows data URIs in src attributes and inline styles, the Network panel shows them in API responses, and the Application panel shows them in local storage. Right-click the value, copy it, and paste it here.
Logs and terminals often cut long lines, which is the most common reason a decode fails as "cut off". If you can, copy the value from the original response or file rather than from a log.
Decoded files are created on your device and never run: images are only displayed, and other files are only offered as downloads. SVG images can contain scripts, but browsers never run scripts in an SVG shown with an image tag, which is how the preview displays it. Be as careful with a decoded file as with any download from an unknown source before opening it in other programs.
Base64 is an encoding, not encryption. If you find sensitive images encoded in an app's responses or storage, anyone with access to that data can decode them just as easily.
Not every data URI holds a photo. Icon libraries often store SVG as Base64 or as a percent-encoded data:image/svg+xml,… URI; both are decoded here and saved as a real .svg file you can open in a vector editor or convert with SVG to PNG. APIs also return PDFs as Base64 (their Base64 starts with JVBERi); those are recognised and saved as .pdf.
See the image an API returned as Base64 and save it to compare.
Extract icons embedded in a stylesheet as data URIs.
Turn thumbnails stored as Base64 text back into files.
Decode inline images from HTML email source.
Check that an app stores and returns the exact image it was given by decoding the stored Base64 and comparing it with the original file.
Paste the Base64 string or data URI into the decoder above and press Extract File & Preview. Check the preview, then download the image.
No. Raw Base64 works too. The decoder reads the first bytes of the decoded data to identify PNG, JPG, GIF, WebP, BMP, ICO, TIFF, AVIF, HEIC, SVG and PDF files.
The decoder trusts the actual bytes. If a data URI says image/gif but contains a PNG, you get a .png file and a note explaining the mismatch.
Browsers cannot display HEIC and TIFF images, so they are decoded and downloadable but not previewed. Convert them afterwards with HEIC to JPG or TIFF to PNG.
The text contains characters Base64 cannot have, or its length shows that part of it is missing. This usually means the string was truncated when copying from a log or a terminal. Copy the complete value and try again.
No. Decoding happens in your browser. Images from private APIs or internal systems stay on your device.
Yes. PDF, ZIP, JSON and text files are recognised and saved with the right extension; unknown data is saved as a .bin file.
Use Image to Base64, which outputs raw Base64, a data URI, an HTML tag or a CSS rule.
There is no fixed limit; decoding happens in your browser's memory. Strings of several megabytes decode in moments, though very long text is slow to paste into any page.