Purplelink
← All tools

Free web tool

Image to Base64

Turn a PNG, JPG, SVG, GIF, WebP or other image into Base64 text: a data URL, the bare string, a CSS background or an HTML img tag, ready to copy. The image is read on your device. Nothing is uploaded.

Options
Output

Bytes of your files sent anywhere: 0

Files are read and converted in this tab, in a background worker. The only requests the page makes are for its own scripts. Your files are never sent anywhere.

How it works

Base64 writes any file as plain letters, digits, + and /, so it can sit inside HTML, CSS, JSON or an email template. The page reads the image's bytes unchanged in a background worker and encodes them, so the picture is exactly the original.

A data URL adds the image's type, such as data:image/png;base64, so a browser can show it from the text alone. The CSS and HTML forms wrap it, ready to paste.

Base64 text is a third larger than the file, and the browser cannot cache it apart from the page, so it suits small icons and images. For large pictures a separate file loads faster.

How to convert Image to Base64

  1. Pick the output. Data URL for most uses, Base64 only for an API or JSON field, CSS or HTML to paste directly.
  2. Add the image. Drop the image on the box, click it to choose it, or paste it.
  3. Copy or download. Use Copy on the row, or download the .txt file.
  4. Paste it. Put the text where the image would go, such as an img src or a CSS url().

Limits

Questions

Are my files uploaded?
No. The page reads each image with your browser and encodes it in a background worker in this tab. There is no server step. The meter under the drop zone counts the bytes the page and its worker send while they work, so you can check this yourself. The only things the page downloads are its own scripts.
What is a data URL?
A URL that holds the file itself, such as data:image/png;base64,iVBOR... Browsers show it like an image file, so it works in an img tag, CSS, or anywhere a URL goes.
When should I not use Base64?
For large images. The text is a third larger than the file and cannot be cached on its own, so pages load slower. It suits icons, small logos and email templates.
Does it change the image?
No. The bytes are encoded exactly as they are, so decoding the text gives back the same file.
Is it free?
Yes. There is no account, no watermark and no limit beyond the size above.

If this saves you time, you can leave a tip. It helps keep these tools free and online.