Image to Base64

Convert an image file into a Base64 data URL.

Turn an image file into a Base64 data URL, or raw Base64 text, that you can paste into HTML, CSS, JSON or an email template. Choose a file, preview it, and copy the result. It accepts PNG, JPG, GIF, WebP, SVG, BMP and ICO files up to 10 MB, which covers icons, logos and small illustrations.

What is a Base64 data URL?

A data URL embeds file contents directly in a string using the form data:[mime type];base64,[data]. For an image this looks like data:image/png;base64 followed by the Base64 text of the file bytes. Browsers can use it anywhere a normal URL fits, such as an img src attribute or a CSS background-image, without a separate network request. That helps with tiny icons, email templates and self-contained HTML files. The cost is size: Base64 adds about a third to the file, and inlined images cannot be cached separately, so large images are better served as files.

How to use Image to Base64

  1. Choose an image Click Choose an image and pick a PNG, JPG, GIF, WebP, SVG, BMP or ICO file.
  2. Check the preview The preview and a line with the file name, type and size confirm the right file was read.
  3. Pick the output form Leave Raw Base64 only (no data: prefix) unticked for a full data URL, or tick it for the encoded bytes alone.
  4. Copy the Base64 Use the copy button on the Base64 box.

Frequently asked questions

Is my image uploaded anywhere?

No. The file is read locally and converted to text on the page; this tool does not send it anywhere.

What is the difference between a data URL and raw Base64?

A data URL starts with data:image/type;base64, followed by the encoded bytes. Raw Base64 is only the encoded bytes. Use the full URL in HTML or CSS and raw Base64 for APIs that ask for it.

What is the size limit?

Files up to 10 MB are accepted. Large images make very long strings, so inline only small ones.

Which formats are supported?

The picker accepts PNG, JPG, JPEG, GIF, WebP, SVG, BMP and ICO files.

How do I turn the Base64 back into an image?

Paste it into the Base64 to Image tool, which previews the image and lets you download it.