Base64 to Image Converter - Decode Data URIs and Save the File

Paste a Base64 string or a data:image URI and get the image back. The real format is read from the decoded bytes, so the download always has the right extension. Decoding runs in your browser.

Paste a string above to decode it. Line breaks, indentation and surrounding quotes are handled for you.

Why You'd Decode Base64 Back to an Image

Inlined images are convenient to ship and awkward to work with. Decoding turns the text back into a file you can open, edit, or attach.

Pull an inlined icon or background out of a stylesheet, a bundled JS file, or the HTML source of an email
See what an unfamiliar data URI in a page, log line, or API response actually contains before you trust it
Turn a Base64 column from a database dump or a JSON payload back into a viewable image
Extract the image from a self-contained HTML page or a generated report that has no separate asset file

How to Convert Base64 to an Image

Paste and look — decoding is immediate and happens entirely in the browser.

1

Paste the string: a full data:image/…;base64, URI, a whole CSS url() declaration or img tag, or bare Base64 with no prefix at all

2

Line breaks, indentation and surrounding quotes are stripped automatically, so copying straight out of formatted source is fine

3

Check the preview along with the detected format, pixel dimensions and decoded file size

4

Download the image — the extension comes from the actual bytes, so a mislabelled prefix cannot hand you a broken file

Frequently Asked Questions

No. Paste it with the prefix or without — both work. The prefix is part of the data URI syntax, not part of the encoded image, so it tells the browser how to interpret the payload that follows. If it is present the tool reads it and shows you what it claimed; if it is missing nothing is lost, because the format is worked out from the decoded bytes either way.
Because the prefix is text, not data. Anyone can type `data:image/jpeg;base64,` in front of PNG bytes, and plenty of generators do it by accident — copying a template, hardcoding a MIME type, or reusing a string after re-exporting the image. Trusting it would save you a file called .jpg that no JPEG decoder can open. This tool reads the leading bytes instead, and when the two disagree it says so and names the file after the bytes.
Almost always an incomplete copy. Long data URIs run to tens of thousands of characters, and a selection that stops at the edge of a viewport, a terminal that wrapped and inserted a backslash, or a diff view that added a leading + on every line all produce strings that cannot decode. Other common causes: HTML entities such as & left in place of &, and the URL-safe variant that uses - and _ instead of + and /, which has to be converted before decoding.
No. Formatters and minifier output routinely wrap long data URIs across lines, and email clients hard-wrap at 76 characters. Whitespace is not part of Base64, so it is removed before decoding. You can also paste the surrounding syntax as-is — a whole `background-image: url("data:…");` declaration, an `img src="…"` tag, or a quoted JSON string — and the payload is extracted from inside it.
None. Base64 is a reversible encoding, not compression and not re-encoding. The decoded bytes are identical to the file that was originally encoded, including EXIF metadata, ICC colour profile and any embedded thumbnail. If the result looks worse than you expected, the loss happened before encoding — for example the image was saved as a low-quality JPEG or resized down first.
Yes. SVG has no binary signature because it is XML, so it is identified by its markup: the decoded text has to open with a tag and contain an `svg` element near the start, past any XML declaration or comment. It downloads as .svg and can be opened in a text editor. Worth knowing for the other direction: SVG is already text, so encoding it as Base64 only adds about a third to its size for nothing.
PNG, JPEG, GIF, WebP, AVIF, BMP, ICO and SVG, each from its own signature at the start of the file. If the Base64 decodes cleanly but matches none of them you will see a clear message rather than a download — that usually means the payload is a PDF, a font, a zip, or plain text that happens to have been Base64 encoded.
No. Decoding is a few lines of JavaScript running in this page: the string stays in the tab's memory, the image preview is a blob URL created locally, and the download is generated on your device. There is no server-side component, no request carrying the payload, and the page keeps working with the network disconnected. That matters here, because pasted data URIs are often screenshots, scans or documents from somewhere private.

More Image Tools

Explore other powerful tools for your image editing needs

Compress Image

Reduce file size

Resize Image

Change dimensions

Crop Image

Cut out area

Convert Format

Change format

Photo Editor

Edit photos

Rotate Image

Rotate image

Flip Image

Horizontal/Vertical

Add Watermark

Add watermark

Add Border

Add image border

Rounded Corners

Add rounded corners

Filters

Brightness/Contrast

Blur Face

Hide faces

Mosaic

Blur regions

Remove Background

Remove BG

Enhance Image

AI upscale

Add Text

Add text to image

Collage

Combine multiple images

HTML to Image

Webpage to image

GIF to Image

Extract frames

Trim Image

Remove empty edges

Batch Rename Images

Safely rename files in bulk

Circle Crop

Crop images into circles

Black & White

Convert images to grayscale

Split Image

Cut an image into a grid

Merge Images

Combine images into one

Change DPI

Set image DPI metadata

Image to Base64

Encode images as Base64

Image to PDF

Combine images into one PDF

HEIC to JPG

Convert iPhone HEIC photos to JPG

EXIF Remover

View and strip hidden photo metadata, including GPS location

Favicon Generator

Full icon set plus HTML

Color Palette

Extract colors from an image

HEIC to PNG

Convert iPhone HEIC photos to lossless PNG

Text Behind Image

Put text behind the subject of a photo, entirely in your browser

Color Picker

Get the HEX, RGB and HSL of any pixel

Signature Maker

Draw a signature and download it as a transparent PNG

Signature Background Remover

Ink from paper, on transparency

Transparent Background Maker

Make a background transparent

Meme Generator

Add top and bottom meme text

Image Upscaler

Enlarge images 2x, 3x or 4x

PDF to JPG

Turn PDF pages into JPG images

PDF to PNG

Turn PDF pages into PNG images

Passport Photo Maker

Crop ID photos to official sizes