Skip to content

Base64 to Image Converter

Decode a Base64 string back into a viewable and downloadable image file directly in your browser.

Base64 to Image Converter tool

Loading...

Example

Input: A raw Base64 string (no data: prefix) that begins with /9j/, copied from an 800 x 600 JPEG

Result: Image Type image/jpeg, Dimensions 800 x 600 px, Aspect Ratio 4:3, with a preview and a decoded-image.jpg download

Without a prefix the tool identifies the format from the first bytes: /9j/ is the Base64 form of the JPEG signature FF D8 FF.

How Raw Base64 Reveals the Image Type

Base64 starts withFormatAuto-detected
iVBORw0KGgoPNGYes
/9j/JPEGYes
R0lGODGIFYes
UklGRWebP (RIFF container)Yes
PHN2ZySVG starting with <svgYes
PD94bWSVG starting with <?xmlYes
QkBMPNo, paste as a data URI

Prefixes are the Base64 encoding of each format signature bytes.

  1. Paste a Base64-encoded image string or data URI into the input text area, or use the Paste from Clipboard button.
  2. The tool automatically detects the image format and renders a live preview.
  3. Verify the decoded image appears correctly and check its dimensions, type, and estimated size.
  4. Click the Download Image button to save the decoded image as a file.
  5. The file is saved in its detected format, such as PNG, JPEG, GIF, WebP, or SVG, with the matching extension.

Decoding a Base64 String Back to an Image

Paste a Base64 string and this tool shows the image it contains, with its type, dimensions and size, and lets you download it as a file. It accepts full data URIs as well as raw Base64 with no prefix.

A data URI names the format in its header, for example data:image/png;base64. Raw strings have no header, so the tool looks at the first characters. Every image format starts with fixed signature bytes, and these always encode to the same Base64 letters. A PNG begins with iVBOR, a JPEG with /9j/ and a GIF with R0lG. The tool recognizes PNG, JPEG, GIF, WebP and SVG this way. Anything else is treated as PNG. So paste BMP or ICO data as a full data URI.

When decoding fails, the string is usually incomplete. Copying from a log or a database viewer can cut it short. Line breaks and spaces inside the string are ignored. Characters outside the Base64 alphabet trigger a clear error. URL-safe Base64, which uses - and _ in place of + and /, needs converting to the standard alphabet first.

The download gets the right extension for the detected type, such as .jpg or .svg. Everything happens in your browser, so the data is not sent anywhere. To go the other way, use Image to Base64. For Base64 that holds text rather than an image, try Base64 Encode and Decode.

Sources

Frequently Asked Questions

Look at the start. A data URI states the type, as in data:image/webp;base64. For raw Base64, the first characters give it away: iVBOR means PNG, /9j/ means JPEG, R0lG means GIF, UklG means WebP (it can also be other RIFF files), and PHN2Zy means SVG. The tool reads these automatically.
The most common cause is a string that was cut off while copying. Check that you have all of it, including any = signs at the end. Other causes are URL-safe characters (- and _), text that is not image data at all, or a raw string of a format the tool cannot detect, which should be pasted as a full data URI.
Yes. Many tools wrap Base64 at 64 or 76 characters per line, for example in email sources and PEM files. Spaces and line breaks inside the data are ignored when the image is decoded, so you can paste the block as it is.
There is no fixed limit, but very long strings, several megabytes of text, can make the page slow while the browser decodes and previews them. The decoded file is about three quarters the length of the Base64 text, and the tool shows its estimated size.

Related Tools

Image to Base64 Converter

Convert any image file to a Base64-encoded string instantly in your browser. No server upload required.

Image and Media

Base64 Encode and Decode

Encode text to Base64 and decode Base64 strings back to readable text, with full UTF-8 support.

Developer Tools

SVG to PNG Converter

Convert SVG vector files to PNG raster images at any resolution directly in your browser using canvas.

Image and Media

Image Resizer

Resize images to exact pixel dimensions with an optional aspect ratio lock, entirely in your browser.

Image and Media

QR Code Generator

Generate QR codes for URLs, text, vCards, and WiFi credentials. Download as SVG or PNG instantly.

Image and Media