Base64 to Image
Paste a Base64 string or full data URL, decode it into an image preview, and download the result as a file in your browser.
Decoded preview
Quick access to image tools
Pick the image tool you need for compression, cropping, resizing, conversion, cleanup, and base64 tasks.
You've got the string. You just need to see what's in it.
When you're working with Base64-encoded images — from API responses, copied markup, stored payloads, or email templates — you can't just look at the string and know if it's correct. You need to decode it. That's what this tool does.
Paste your Base64 string or full data URL, click convert, and see the image immediately. If it looks right, download it. If something's off — partial data, wrong encoding, mismatched MIME type — you'll know in seconds instead of spending time debugging blindly.
What situations actually bring people to this page
Base64-to-image conversion is almost always a debugging or recovery task. A few common situations:
- API response inspection — a vision or OCR API returns its result with an image attached as a Base64 string, and you need to see what it actually returned
- Broken email template — an inline data URL image stopped rendering and you want to verify the encoded value is still valid
- Database or backend debugging — image data got stored as Base64 in a database column and you're checking if it looks correct before the frontend renders it
- Copied HTML or markdown — you grabbed a code snippet with an inline data URL and want to extract the actual image from it
- Missing source file recovery — the original image file is gone but you still have the Base64 version in source code or logs, and you want to save it back as a file
- Integration testing — you're sending Base64 images between systems and need to confirm the encoding round-trips correctly
What input formats this tool accepts
You can paste either a raw Base64 string or a full data URL. Both work:
- Full data URL (e.g.
data:image/jpeg;base64,/9j/4AAQ...) — the tool reads the MIME type from the prefix and uses it to correctly identify the format and name the download file - Raw Base64 string (starts with something like
iVBORfor PNG,/9j/for JPG) — works too, though the tool may have to guess the image type
When in doubt, paste the full thing including the prefix. The MIME type in the prefix is what makes format detection reliable.
What if the image doesn't render?
If you paste a string and the preview doesn't appear, a few things might be wrong:
- The string might be truncated — copy-pasting long Base64 strings from terminal output or logs sometimes clips the end
- The MIME type in the prefix might be wrong — if the string says it's a PNG but is actually a JPG, the browser may refuse to render it
- The Base64 might have extra whitespace, newlines, or escaping characters from how it was stored
- The encoding might be URL-encoded Base64 instead of standard Base64 — some systems use a slightly different character set
The preview step exists precisely for this reason: you find out immediately whether the data is valid before spending more time investigating why it's not rendering somewhere else.
Recognising the Base64 string format before you paste
Not all Base64 strings look the same, and knowing the difference between formats helps you paste the right thing. Here's a quick reference:
- Full data URL — starts with
data:image/followed by the format (png,jpeg,webp,gif) then;base64,and then the encoded content. This is the most common format you'll encounter in HTML, CSS, and browser-side JavaScript. - Raw Base64 (PNG) — starts with
iVBORw0KGgo. If you see this at the beginning of a long string, it's a PNG. - Raw Base64 (JPG) — starts with
/9j/4AAQ. The leading characters for JPG are slightly different because JPG files start with a different binary signature. - Raw Base64 (GIF) — starts with
R0lGOD. Less common in modern workflows but still appears in older codebases. - Raw Base64 (WebP) — starts with
UklGR. Less recognisable but valid input for this tool.
Knowing these "magic prefixes" is handy when you're staring at a long string in a log file or API response and need to know what you're dealing with before pasting it anywhere.
Common workflows that produce Base64 images
Base64 images tend to appear in specific technical contexts. If you're regularly hitting this page, you're likely working with one of these:
- AI and machine learning APIs: Vision APIs from OpenAI, Google Cloud, Amazon Rekognition, and similar services often accept images as Base64 strings and sometimes return annotated or processed images in the same format.
- PDF generation libraries: Tools like wkhtmltopdf, Puppeteer, and DomPDF embed images as Base64 data URLs to produce self-contained PDF documents. If you're debugging why an image isn't appearing in a generated PDF, inspecting the Base64 value it's using is a useful step.
- Email template engines: Email builders and HTML email editors sometimes inline all images as Base64 data URLs to avoid spam filter issues with external image links. If a client-side email tool exports HTML, the images may be embedded this way.
- Browser screenshot tools: Puppeteer, Playwright, and similar headless browser tools can capture page screenshots as Base64 strings via the
screenshot({ encoding: 'base64' })option. Decoding that output into an actual image lets you verify the capture visually. - Mobile apps and web APIs: Apps that process or generate images often transmit them as Base64 strings in JSON payloads. If you're building or debugging an integration with such an API, this tool lets you validate the image content without writing any additional code.
Saving the decoded image — and what format it becomes
When you decode a Base64 string using this tool and download the result, the output format matches the MIME type from the data URL prefix. A data:image/png;base64,... string downloads as a PNG. A data:image/jpeg;base64,... string downloads as a JPG. If you paste a raw Base64 string without a prefix, the tool makes its best guess based on the encoded content — but using the full data URL always produces more reliable format detection and a correctly named file.
If you need the image in a different format after decoding, run the downloaded file through the Image Converter. That way you decode first to verify the content, then convert to whatever format your workflow actually needs.
Frequently Asked Questions
data:image/...;base64, prefix) is actually preferred because the tool can read the MIME type from the prefix and name your download file correctly.