PNG to Base64

Convert a PNG to Base64

Encode a PNG to a Base64 string or data URI — transparency intact, with copy-ready CSS and HTML — free and right in your browser.

Solte uma imagem para codificar

Arraste e solte, cole ou escolha um arquivo

PNG · JPG · WebP · GIF · SVG — codificado no seu dispositivo

Keeps transparencyCopy or .txtNo sign-up PNG · JPG · WebP · GIF · SVG

Encoding PNG images to Base64

PNG is the format for logos, icons, screenshots, and anything with a transparent background — exactly the kind of small asset you often want to inline as Base64. Encoding a PNG to a data URI lets you drop it straight into a CSS file or HTML email with no extra request, and the transparent areas are preserved exactly because Base64 copies the file byte-for-byte.

This tool reads your PNG in the browser and returns the raw Base64 body, the full data:image/png;base64 URI, and ready CSS and HTML snippets. Nothing is re-compressed, so the decoded image is identical to the original PNG.

How to convert a PNG to Base64

  1. Open your PNG. Drag the PNG onto the tool above, choose a file, or paste it from your clipboard.
  2. Pick your output. Switch between the raw Base64, the data:image/png URI, a CSS rule, or an <img> tag.
  3. Copy or download. Tap Copy, or save the Base64 as a .txt file.

Great for transparent icons

Because PNG keeps an alpha channel, inlining a transparent PNG as a data URI is ideal for small icons that sit on coloured backgrounds — no separate file, and the transparency just works.

More Base64 & data URI tools

Perguntas frequentes

Does encoding a PNG keep transparency?

Yes. Base64 copies the PNG's exact bytes, including the alpha channel, so transparency is fully preserved when the string is decoded back.

Is PNG-to-Base64 lossless?

Yes. There's no re-compression — the Base64 is an exact text representation of the original PNG file.

What does the data URI look like for a PNG?

It starts with data:image/png;base64, followed by the encoded body, e.g. data:image/png;base64,iVBORw0KGgo…

Where is my image processed?

The encoding and decoding happen in your browser, so the result is created on your own device. How any data associated with the tool is handled is described in our privacy policy.

Mais ferramentas de imagem