iShowPDF

PNG to Base64

PNG to Base64 converts a .png image, such as an icon, logo or screenshot, into a Base64 string or a data:image/png link.

What PNG to Base64 does

PNG to Base64 converts a .png image, such as an icon, logo or screenshot, into a Base64 string or a data:image/png link. PNG keeps transparency, so it is the usual choice for small interface graphics embedded in code.

The file picker is set to PNG files, which avoids mixing up formats. The bytes are encoded exactly as they are, so transparency and colours come through unchanged. You can paste the result into an HTML img tag, a CSS rule, a JSON payload or an app's resource file.

How to use PNG to Base64

  1. Select a PNG

    Press Choose file; the picker shows PNG files.

  2. Choose link or plain text

    The data:image/png link is ready for HTML and CSS; plain Base64 suits APIs.

  3. Copy or save

    Copy it in one click, or download it as a text file.

Questions about PNG to Base64

Does a transparent PNG stay transparent in Base64?

Yes. Encoding does not touch the pixels, so see-through areas stay see-through when the image is shown.

Should I shrink the PNG first?

It helps. A smaller PNG gives shorter Base64 text, so compress or resize large images before you encode them.

How do I turn it back into a PNG?

Use Base64 to PNG and paste the text there.

Where is the encoding done?

On your device. The PNG is read by your browser and is not uploaded.

Related tools