Skip to content
OnlineToolStudio

Image to Base64

runs in your browserno sign-upfree

Convert an image to a Base64 data URI, CSS background or HTML <img> tag to embed in code.

About this tool

This tool converts an image into Base64 text, so you can put it straight into HTML, CSS, JSON or an email template instead of linking a separate file. Get a ready-to-use data URI, only the Base64 code, a CSS background rule or a complete HTML <img> tag. Works with PNG, JPG, SVG, GIF, WebP and ICO.

How to use

  1. Drop an image, click to choose one, or paste a screenshot.
  2. Choose the output: data URI, Base64 only, CSS background or HTML <img>.
  3. Copy the code or download it as a text file.

FAQ

When should I use a Base64 image?

For small images such as icons, logos and simple backgrounds — embedding them saves a separate download. Large photos as Base64 are about 33% bigger than the file and cannot be cached separately, so link them as normal files instead.

Why is the Base64 version bigger than the image?

Base64 writes every 3 bytes of the file as 4 text characters, so the result is about one third larger. This is normal.

What is a data URI?

A data URI is a link that contains the file itself, like data:image/png;base64,iVBOR… It works anywhere a normal image URL works — in an <img> src, a CSS url() or a Markdown image.

Is my image uploaded?

No. The image is read by your browser, so it never leaves your device.

Related tools

All tools