html69// dev utilities

Encoding tool

Image to Base64 Converter / Base64 to Image Converter

Encode a PNG, JPG, GIF, or WebP as Base64, CSS background-image, or an HTML data URI. Decode Base64 to a live preview and download PNG, JPG, or WebP. Conversion stays on your device.

Like the tool? Find a bug?Share with us

Converter

Wrap

Convert an image to Base64, CSS, or HTML, or paste a data URI to preview and download. FileReader and canvas stay on your device.

Supported files: .png, .jpg, .jpeg, .jfif, .gif, .webp, .bmp, .ico
0 / 8,388,608 bytes
Drop a PNG, JPG, GIF, WebP, BMP, or ICO.
Drop a PNG or JPG file here (.png, .jpg, .jpeg, .jfif, .gif, .webp, .bmp, .ico)
A data URI will appear here.

Preview

Image preview appears here.

Guide

How this image to Base64 converter works

01

Image becomes Base64

To Base64 reads the file with FileReader. Wrap as raw Base64, a data:image/… URI, CSS background-image, or an img tag.

02

Base64 becomes an image

To Image accepts a data URI, url(), an img src, or raw Base64. The preview uses an image element so nothing is uploaded.

03

Download PNG, JPG, or WebP

Canvas redraws the decoded bitmap and exports PNG, JPEG, or WebP in this tab. Animated GIF frames flatten to the first frame on export.

Use it

What converts well

Raster files: PNG, JPG, GIF, WebP, BMP, and ICO, including screenshots up to 8 MB. The Base64 preview is truncated so a large dump cannot freeze the tab; copy and download still use the full string. For SVG markup use the SVG to Base64 tool. Text Base64 without an image payload belongs on the Base64 Encoder / Decoder.

FAQ

Questions

Does this upload my image?

No. FileReader, preview, and canvas export run in the browser. There is no account and no API call.

Image to Base64 or SVG to Base64?

This tool is for raster images. SVG to Base64 encodes vector markup, including UTF-8 data URIs and minify, which canvas cannot preserve.

CSS background-image or HTML img?

CSS wrap copies background-image: url("data:…");. HTML wrap copies an img tag with the same data URI. Raw is the Base64 payload only.

Is there a size limit?

Files are capped at 8 MB so a normal screenshot fits. The on-screen Base64 is truncated; copy and download still use the full string so the tab stays responsive.