Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

Base64 to Image

A file instead
Base64

Paste Base64, or

CtrlV paste · Ctrl↵ run now

Image
Ready
Ln 1, Col 1
Runs in your browser. Nothing you paste is uploaded unless you share it.

Paste Base64 or a data URI to see the image, its type and size, then save it as PNG, JPEG, WebP, GIF or BMP

Paste Base64 or a data:image URI and see the picture. The type comes from the bytes themselves, the size in pixels from its header; download the file or copy a clean data URI.

How to use it

  1. Paste the Base64, with or without the data:image/…;base64, start. Line breaks and URL-safe characters are fine.
  2. The image is drawn on a checkerboard, so transparent parts show; the status bar names its type, size in pixels and bytes.
  3. Download saves it as decoded.png (or .jpg, .gif, .webp, .svg…); Copy takes it as a data URI.
  4. To change the format, press PNG, JPEG, WebP, GIF or BMP under the image: it is redrawn at its own size and saved in that format.

Examples

A 1×1 transparent GIF

Input
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
Result
GIF image, 1 × 1 px, 42 bytes. Download saves it as decoded.gif; Copy takes it as a data URI.

The classic tracking pixel and spacer image.

A data URI that names the wrong type

Input
data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGNgYGD4DwABBAEAwS2OUAAAAABJRU5ErkJggg==
Result
The data URI says image/jpeg; the bytes are PNG (image/png).

Browsers usually draw it anyway, but a server or an email client that trusts the type may not.

What the image tells you

The type is read from the first bytes of the file (a PNG starts with the bytes 89 50 4E 47, a JPEG with FF D8 FF), not from the data URI, so a wrong or missing type is found. The width and height come from the file’s header, before anything is drawn.

PNG, JPEG, GIF, WebP, AVIF, BMP, ICO and SVG are drawn. Other files (a PDF, a ZIP) are named and can be downloaded.

Safe with Base64 you did not make

An SVG can hold scripts. Here it is drawn as a picture, which runs no script and loads nothing from the web. An image whose header claims more than 50 megapixels is not drawn, so a small file can’t fill your device’s memory; it can still be downloaded.

Questions

Do I need the data:image/png;base64, part?
No. Paste the Base64 with or without it; the type is found from the bytes. Copy always gives the full data URI with the right type, ready for an img src or a CSS url().
Why does it say the Base64 decodes to text?
The bytes are readable text and not an SVG, so they are not an image. Base64 Encode & Decode shows such text in full.
Can I save it in another format?
Yes. Under the image, Save as writes PNG (lossless), JPEG (transparent parts become white), WebP, GIF (256 colors; parts under half opacity become transparent) or BMP (32-bit, transparency kept), at the image’s own size. An SVG is saved as pixels at its drawn size. A browser that can’t write WebP says so instead of saving another format.
How do I turn an image into Base64?
Open it in File & Image to Base64: it gives the Base64 or a data URI, ready for HTML or CSS.
Is my data or file uploaded?
No. Everything runs in your browser, so your data stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. That includes files you open.

Related tools