EIT easy-image-tools / Convert PNG to Base64

Convert PNG to Base64

Encodes the image into a base64 string for embedding in code or styles.

01

Convert PNG to Base64

Nothing found — try another word.

This tool has no parameters — the result is ready as is.

Preview
Source
Drop a PNG here or click / paste (Ctrl+V) — processed locally
Result
no result yet

Convert PNG to Base64 turns the image into a text string that is safe to paste into source code: a CSS background, an HTML attribute, a JSON config or an email template. The string appears in the result panel with a copy button, and it works as a data URI directly. The image is read and encoded in your browser — the string is the image itself, so it never leaves your device.

  • Encoding runs entirely in your browser: neither the image nor the string is uploaded.
  • The result works as a ready-made data URI for src or background-image.
  • Base64 adds about a third to the size: it is a transport encoding, not compression.
  • Free with no daily limit, no account, also for commercial use.

How to use it

  1. Drop the image into the source area, or pick a file from your device.
  2. Wait for the string to appear in the result panel.
  3. Press the copy button to put the whole string on the clipboard.
  4. Use it in CSS as url(data:image/png;base64,...) or paste it where you need.

Questions

Why is the string longer than the file?

Base64 stores six bits per character, so it costs about 33 percent more characters than the raw bytes: a 300 KB PNG becomes roughly 400 KB of text. It is a transport format, not a compression one.

Should I embed images as Base64?

For small assets - icons, sprites, logos, a few kilobytes - yes, it removes a request and guarantees the image travels with the file. For photos and anything large it usually hurts: the text is bigger, it cannot be cached separately and it blocks parsing.

Is the string the whole image?

Yes, which is why this page never uploads anything. A Base64 string of your picture is as sensitive as the picture itself, so keep it on your machine.

What is the difference between Base64 and a data URI?

A data URI is the full string you put in an attribute: the prefix with the MIME type, then the Base64 payload. Copy the data URI variant when you need the ready-made value for src or background-image.

Related tools