Encoder

PNG to Base64 converter

Drop a PNG and copy it as Base64, a data URI, an <img> tag or a CSS background. Transparency is kept. Free, in your browser.

Encoding and decoding happen on your device. Only the optional AI extras upload an image, and it is deleted after 24 hours.

Drop images here, or paste with Ctrl+V

PNG, JPG, GIF, WebP, SVG, AVIF, BMP or ICO · up to 25.0 MB each · 20 at a time

Runs in your browser. Nothing is uploaded.

PNGs keep their transparency. The data URI tab is selected.

PNG to data URI in one step

The data URI tab opens first, ready for an src attribute or a CSS url(). Transparency and colour profile stay exactly as in your file.

Is the PNG small enough to inline?

Each result shows its length and a verdict: under 10 KB inline it, over 32 KB keep it as a file.

Shrink a big PNG

PNG screenshots and photos get large. The shrink panel re-encodes to WebP or JPEG at a target size before you copy.

Many PNGs at once

Drop up to 20 PNGs at once and copy each one. Asset Pipeline adds one-click export of up to 200 files as a ZIP, CSV or CSS sheet.

FAQ

PNG to Base64 questions

How do I convert a PNG to Base64?

Drop the PNG above and copy the result. It all happens in your browser in a moment.

Does Base64 keep PNG transparency?

Yes. Base64 is the same bytes written as text, so transparency and every pixel stay the same.

What's the difference between Base64 and a data URI?

A data URI is the Base64 with a data:image/png;base64, prefix, so browsers can use it as an image address.

How do I use a PNG as a CSS background in Base64?

Pick the CSS tab and paste the rule into your stylesheet. It sets background-image to the data URI.

Is my PNG uploaded?

No. The conversion runs on your device; nothing is sent anywhere.

Last updated: