Convert PNG to Base64

Convert a PNG image to a Base64-encoded string.

Drop an image here

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

No result yet

Options

How to use

  1. 1

    Upload a PNG file.

  2. 2

    Enable "Data URL format" to include the full data URI prefix.

  3. 3

    Enable "Split into lines" and set the line length to chunk the output.

  4. 4

    Copy the text or download it.

Example

Before640 × 427

The example input

After26,784 characters

iVBORw0KGgoAAAANSUhEUgAAAoAAAAGrCAYAAABQTiZLAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nOzdd5wU5f0H8M/M9r3eC9zBccBRpAko0q2RqJjE3lusiSUmMSbRnyWxRBNbbNFo7CF2RAELglIFpNfjjuu9l+27M78/7jhub+d6md2bz/v1mhfc7Mwz35k5uO8933meEeY9bJdBRERERJqhFwTmf0RERERaohfUjoCIiIiIhpSodgBERERENLRYAiYiIiLSGJaAiYiI…
Convert PNG to Base64 on a sample photo, with the default settings.

Frequently asked questions

What is the difference between Base64 and a Data URL?

A Data URL includes the MIME type prefix (data:image/png;base64,) so it can be used directly in HTML or CSS. Base64 alone is just the encoded bytes.

Why split into lines?

Some protocols like email (RFC 2045) require Base64 data in 76-character lines. Most web uses do not require line breaks.

About this tool

Convert PNG to Base64 reads a PNG file and outputs the raw Base64 string or a full data URL. You can split the output into fixed-length lines following the RFC 2045 convention. Encoding happens entirely in your browser. No files are uploaded.