Base64 Image Extractor – Free

Paste a Base64 image string taken from an API response, a database field or a log line. This Base64 image extractor decodes it, shows a preview and offers the picture as a file.

How to use the Base64 image extractor tool

  1. Paste the image string into the Base64 or Base64 data URL box. Paste the value only, without surrounding quotes, JSON keys or markup.
  2. Select Decode image, or select Example to try a 2 by 2 pixel PNG.
  3. Check the Result box for the byte count and detected type, and look at the preview below it.
  4. Select Download to save the picture as decoded.png, decoded.jpg, decoded.gif or decoded.webp.

How the Base64 image extractor identifies a picture

After decoding, the tool looks at the first bytes of the data, the signature that each of these formats writes at the start of a file. PNG begins with 89 50 4E 47 0D 0A 1A 0A, JPEG with FF D8 FF, GIF with the text GIF87a or GIF89a, and WebP with RIFF followed four bytes later by WEBP.

Because the format comes from the content, a bare string with no label still gets the right extension. Those signatures also make the Base64 itself recognizable: PNG data starts with iVBORw0KGgo, JPEG with /9j/, GIF with R0lGOD and WebP with UklGR.

A worked example

The sample is 108 characters of Base64. It decodes to 79 bytes, the first eight of which are the PNG signature, so the result line reports image/png and the download is named decoded.png. The file is the decoded bytes exactly: nothing is resized or re-encoded.

Input:   iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAFklEQVR42mP8v4CfgYGBiYGBgYGBAQAVQgGy9omCFwAAAABJRU5ErkJggg==
Result:  79 bytes · image/png
File:    decoded.png

Supported input and limits

The input box takes one encoded value in any of these shapes.

  • Standard Base64 with + and /, padded or not.
  • Base64URL with - and _, as returned by some storage and messaging APIs.
  • Text wrapped over several lines. Whitespace is ignored.
  • A data URL. The part up to base64, is dropped and its media type is not trusted.
  • Not supported: SVG, BMP, ICO, TIFF and AVIF. They stop with The Base64 does not contain a supported image format.
  • Not supported: a value still inside an img tag, a CSS url() wrapper or a JSON document. The tool does not search text for images.

Why an extracted image fails or looks broken

An error that asks for valid Base64 or Base64URL data points at the text. Common causes are a string cut short by a log viewer, JSON escapes such as a backslash before each slash, or percent-encoded characters like %2B left over from a URL.

A preview that shows a broken or partial picture points at the bytes. Only the signature is checked, so a truncated image whose Base64 is still well formed passes and downloads. Compare the reported byte count with the size you expect. If the decoded data is itself Base64 text, the value was encoded twice: run it through Unwrap nested Base64 first.

Frequently asked questions

Which image formats can the extractor handle?

PNG, JPEG, GIF and WebP. The decoded bytes must start with one of those four signatures. Vector SVG and formats such as BMP, ICO and AVIF are rejected with a message about unsupported image data.

Do I need the data:image prefix?

No. A bare Base64 string works, because the type is read from the image signature. If a prefix is present, it is removed and the declared type is ignored.

Can it pull images out of an HTML or CSS file?

No. It decodes one value per run and does not scan documents. Copy the Base64 part of a single src attribute or url() value and paste that alone into the box.

Is the image sent to a server for decoding?

No. Decoding happens in the page, and the preview is a temporary object URL that points at memory in your own browser tab. Clearing the form or closing the tab discards it.

What file name does the download use?

The file is always called decoded with the extension of the detected format: decoded.png, decoded.jpg, decoded.gif or decoded.webp. Rename it after saving if you need the original name.

Related tools