Image Tools

Image to Base64

Convert an image into a Base64 data URI you can paste straight into HTML or CSS — no external file needed.

Tool

About the Image to Base64 Converter

The Image to Base64 Converter turns an image file into a Base64 data URI — a long text string that contains the entire image. You can paste it directly into HTML, CSS or JavaScript, so the browser does not need to request a separate file.

How to use it

  1. Choose an image.
  2. Click Convert to Base64.
  3. Copy the data URI or the ready-made CSS background rule.

When to inline images

  • Icons and logos: tiny images that would otherwise be a separate request.
  • Emails: many email clients block external images, but inline data URIs usually display.
  • Single-file pages: embedding everything keeps a page self-contained.

The trade-offs

Base64 makes text about 33% larger than the original binary, and it cannot be cached separately by the browser. That makes it great for small images and a bad idea for large photos. As a rule, inline anything under about 10 KB and load anything larger as a normal file.

Tips

  • Use the Image Compressor or Image Resizer first so the inlined image is as small as possible.
  • Use PNG for logos with transparency and JPEG for photos before encoding.
  • Keep the data:image/png;base64, prefix — it tells the browser the image type.

Who it is for

Web developers, email designers and anyone building a self-contained HTML file.

Privacy

Encoding happens in your browser — nothing is uploaded.

Frequently asked questions

Yes — roughly 33% larger, because binary data is written using printable characters. It is best for small images.
Yes. The tool generates a ready-to-paste background-image: url("...") rule.
Any image the browser can open — PNG, JPEG, GIF, WebP and more. The data URI keeps the image's MIME type.

Related tools

Guides for this tool