Image Tools

Free Base64 to Image Decoder

Paste any Base64 string or data URI — the tool auto-detects the format, previews the image, and lets you download it as PNG, JPG, WebP or BMP. All in your browser.

Auto-detect Format 100% Private Handles Data URIs Works on Mobile

Your Base64

Drop a .txt file with Base64
or click to browse — you can also just paste below
Paste Base64 string or data URI
0 characters Live decoding as you paste
Tip: Whitespace, newlines and the data:image/…;base64, prefix are all handled automatically. Just paste whatever you have.

Decoded Image

No image decoded yet

Paste Base64 in the left panel to see the preview

What Is Base64?

Base64 is a method of encoding binary data using only 64 printable ASCII characters: A–Z, a–z, 0–9, + and /. It exists because many text-based systems (HTML, CSS, JSON, XML, email) can't safely carry raw binary data — but they handle text just fine.

When you see a long string like iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==, you're looking at an encoded image. This tool decodes it back into a real image file you can preview and download.

The two forms of Base64 input

FormExampleWhere you see it
Data URI data:image/png;base64,iVBOR… HTML src attributes, CSS url(), JSON APIs
Raw Base64 iVBORw0KGgoAAAA… API responses, database fields, log files
Base64url iVBORw0KGgoAAAA… with - and _ JWT tokens, URL query strings

This tool accepts all three. The prefix (or lack of one) doesn't matter — the format is detected from the decoded data itself.

Why magic bytes beat prefixes

Many decoders trust the MIME type declared in the data URI prefix — data:image/png;base64,…. This is unreliable: developers frequently copy-paste the wrong prefix, or omit it entirely when sending raw Base64 through an API.

This tool uses magic bytes instead — it reads the first few bytes of the decoded data and matches them against known signatures:

FormatMagic bytes
PNG89 50 4E 47 0D 0A 1A 0A
JPEGFF D8 FF
GIF47 49 46 38 ("GIF8")
BMP42 4D ("BM")
WebP52 49 46 46 … 57 45 42 50 ("RIFF"…"WEBP")
ICO00 00 01 00
SVGText starting with <svg or <?xml

This is how operating systems and browsers identify files too, so it's the most reliable approach.

Common reasons a Base64 string fails to decode

About output formats

You can download the decoded image in five formats:

Common use cases

Recover Embedded Images

Extract images from API responses, log files or database dumps.

Debug Base64 APIs

Quickly verify that a Base64 payload is a valid image.

Convert Inline CSS

Pull images out of CSS url() data URIs back into files.

Security Analysis

Inspect suspicious Base64 strings before trusting them.

Extract Icons

Recover icons and favicons that were embedded as data URIs.

Database Migration

Export images stored as Base64 text fields into real image files.

Git Cleanup

Decode Base64 blobs committed into source files back into assets.

Format Conversion

Turn Base64 PNGs into JPGs for compatibility with older systems.

Privacy and security

This Base64 to image decoder runs entirely in your browser. The decoding uses the standard atob function, the preview uses a blob URL, and any re-encoding uses the Canvas API. Nothing is uploaded, stored or transmitted. Safe for confidential assets, client work and API debugging with sensitive tokens.

Frequently Asked Questions

How do I convert Base64 to an image?
Paste your Base64 string or data URI into the input box. The tool decodes it, detects the image format from the file's magic bytes, and shows a live preview. Then choose an output format and click Download Image.
What is the difference between a data URI and raw Base64?
A data URI includes a prefix like data:image/png;base64, followed by the encoded data. Raw Base64 is just the encoded string with no prefix. This tool accepts both — paste whichever you have.
Why does my Base64 string not decode?
The most common reasons are: the string has been truncated (missing characters at the end), it contains invalid characters like spaces or quotes, or it is URL-encoded data rather than Base64. This tool strips whitespace and handles both Standard and Base64url variants — but it cannot fix a string that is fundamentally truncated.
Does decoding affect image quality?
No. Base64 is a lossless encoding. If you download in the Original format, the decoded file is byte-for-byte identical to what was encoded. If you convert to a different format (like PNG to JPEG), quality may change depending on the target format.
How does the tool detect the image format?
It reads the first bytes of the decoded data — the magic bytes — and matches them against known signatures. PNG starts with 89 50 4E 47, JPEG with FF D8 FF, GIF with 47 49 46 38, and so on. This is more reliable than trusting the prefix in a data URI, because prefixes are often wrong or missing.
Can I convert Base64 to PNG, JPG or WebP?
Yes. Choose from Original (keeps the detected format), PNG, JPG, WebP or BMP. Converting to a different format uses the Canvas API in your browser.
What if the Base64 is an SVG?
SVG data is detected by looking for a <svg or <?xml tag in the decoded text. Downloading in Original format gives you the .svg file. Converting to PNG/JPG/WebP/BMP renders the SVG to a raster image using the browser's SVG renderer.
What if the Base64 is an animated GIF?
Downloading in Original format preserves the animation. Converting to PNG, JPG, WebP or BMP captures only the first frame, because the Canvas API cannot process animation frames.
Is my data sent to a server?
No. All decoding happens locally in your browser using the atob function and Canvas API. Your Base64 data never leaves your device — nothing is uploaded, stored or transmitted.
Is this Base64 to image decoder free?
Yes. It is 100% free, requires no sign-up, and runs entirely in your browser. No file limits, no watermarks, no premium tier.

Related Image Tools

Done!