Tabwrench tools Small tools that run in your browser. No sign-up, no upload.
Tools / Encode / decode / Base64 to image

Base64 to image

Paste a Base64 string or a whole data: URI. The page shows the picture and tells you its format, byte size and pixel dimensions.

Runs in your browser. Nothing you paste leaves this page.
Options
Examples:

Use this often? Add the page to your home screen or bookmarks from the browser menu. It opens straight to the tool.

What you can paste

  • A bare Base64 string, such as the value of an image field in an API response.
  • A complete data URI starting with data:image/png;base64,. The header is skipped automatically.
  • URL-safe Base64 and strings with the = padding missing.
  • Strings broken across lines, as they appear in emails or PEM-style files. Line breaks and spaces are ignored.

Recognising an image from its first characters

The file type is decided by the first bytes of the data, not by any label. Because of that, each format always starts with the same Base64 characters.

FormatFirst bytes (hex)Base64 starts with
PNG89 50 4E 47iVBORw0KGgo
JPEGFF D8 FF/9j/
GIF47 49 46 38R0lGOD
WebP52 49 46 46 … 57 45 42 50UklGR
SVG3C 73 76 67 (<svg)PHN2Zy
PDF25 50 44 46 (%PDF)JVBERi0

When the picture does not appear

  • “Not allowed in Base64” means a stray character was copied, often a quote, a comma or \n written out as two characters. The message gives its position.
  • A picture that is cut off part way down means the string was truncated. Compare the byte size shown with the size you expected.
  • “Binary data” with unfamiliar first bytes means the content is not an image, or it is compressed or encrypted.

Questions

How do I save the image?

Right-click the preview and choose “Save image as”. The file is created by your browser from the decoded bytes.

Is the image uploaded to show the preview?

No. The bytes are decoded in this tab and displayed from memory.

Related tools