Skip to main content

Base64 to Image

Turn a Base64 string or data URI into an image. The real format (PNG, JPEG, GIF, WebP, SVG and more) is detected and the file downloads.

How the format is recognised

FormatFirst bytesExtension
PNG89 50 4E 47 0D 0A 1A 0A.png
JPEGFF D8 FF.jpg
GIF47 49 46 38.gif
WebP52 49 46 46 … 57 45 42 50.webp
BMP42 4D.bmp
ICO00 00 01 00.ico
AVIF… 66 74 79 70 61 76 69 66.avif
SVG<svg or <?xml (text).svg

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Free Base64 to Image

Paste Base64 text, with or without the data:image/…;base64, start, and see the picture. The tool checks the real file type from the first bytes. It gives developers a quick browser-based way to solve a focused base64 to image task before moving the result into a project.

How to use Base64 to Image

Paste the Base64 and the picture appears. The size and format are shown, and the file can be downloaded.

Common mistakes

  • Pasting the whole HTML tag or CSS rule: paste only the Base64 or the data URI.
  • Adding line breaks or spaces: they are removed, but other text is not.

Frequently asked questions

What is a data URI?
A link that holds the file itself: data:image/png;base64, followed by the Base64 text. It is used inside HTML and CSS.
Why does the type in the prefix not matter?
The prefix can be wrong. The tool reads the first bytes of the file, which tell the real format, and warns when they differ.
Can I decode a PDF?
This tool is for images. If the data is another known type, the message names it.
Is the image uploaded?
No. It is decoded in your browser and never sent anywhere.
How do I use this base64 to image tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Code & Conversion

View all Code & Conversion tools →