Convert PNG to Data URI

Convert a PNG image to a Data URI string.

Drop an image here

PNG, JPG, WebP, GIF or BMP. You can also paste an image.

No result yet

How to use

  1. 1

    Upload a PNG file.

  2. 2

    Copy the generated Data URI or download it as a text file.

  3. 3

    Paste the URI into your HTML or CSS.

Example

Before640 × 427

The example input

After26,806 characters

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAoAAAAGrCAYAAABQTiZLAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nOzdd5wU5f0H8M/M9r3eC9zBccBRpAko0q2RqJjE3lusiSUmMSbRnyWxRBNbbNFo7CF2RAELglIFpNfjjuu9l+27M78/7jhub+d6md2bz/v1mhfc7Mwz35k5uO8933meEeY9bJdBRERERJqhFwTmf0RERERaohfUjoCIiIiIhpSodgBERE…
Convert PNG to Data URI on a sample photo, with the default settings.

Frequently asked questions

How is a Data URI different from Base64?

A Data URI is the complete string including the MIME type prefix. You can paste it directly into an img src attribute or CSS background-image.

Are there size limits?

Very large images produce very long URIs. Some browsers have limits on attribute length, so keep source images reasonably small for inline use.

About this tool

Convert PNG to Data URI reads a PNG file and outputs the full data:image/png;base64, URI string. You can embed this URI directly in HTML, CSS, or JavaScript to use the image without a separate file request. Conversion runs entirely in your browser. No files are uploaded.