Skip to content

Image to Base64 Converter

Encode images to Base64 data URIs for embedding in CSS and HTML.

  • No uploads
  • No account
  • No ads
  • No watermarks
  • Free forever

Network check starts when you add a file or change something in the tool

Blocks every fetch, XHR and beacon request this page makes and switches Google Analytics off, on tool pages, for this session.

Requests this page makes are counted from then on; page-load requests are left out.

How this works / check it yourself

From the moment you add a file or change something in the tool, this badge lists the requests this page makes. It reads the browser's own list of requests (Resource Timing), which shows a request once it finishes, and watches every fetch, XHR and beacon call. Downloads, such as this site's PDF and OCR engines or an AI model from Hugging Face, are listed apart from requests that carry data out.

This page cannot see requests made inside background workers (such as the PDF engine pdf.js and Tesseract OCR), WebSocket and EventSource connections, form submissions, link pings or the site's service worker, so they are not counted here, and offline mode cannot block them. A request is listed once it finishes. Your browser's Network tab shows everything.

Offline mode blocks the fetch, XHR and beacon calls this page makes. A part of the site that set up its connection before the page finished loading, such as sign-in, is not blocked; if it sends anything, the badge counts it as sent.

  1. Open your browser's developer tools (F12, or Cmd+Option+I on a Mac) and choose the Network tab.
  2. Add your file, run the tool and look for any request that uploads it. Requests made by workers are listed there too.
  3. For the strongest test, turn Wi-Fi off once the page has loaded and run the tool again: tools that need no download still work.
All Developer Tools

About Base64 Image Encoder

Drop an image to convert it to a Base64 data URI, ready to paste as a CSS background-image rule or an HTML img tag. The tool shows a preview and compares the file size with the size of the text. The image is read in your browser, so it is not uploaded. It accepts images up to 5 MB.

How to use Base64 Image Encoder

  1. Drop an image or click to choose one from your device.
  2. Pick Data URI, CSS or HTML <img> output.
  3. Copy the Base64 text into your code.

Limits: Image files only, up to 5 MB. It encodes images to Base64 but does not decode Base64 back to an image. The Base64 text is about a third larger than the file.

Frequently asked questions

How do I convert an image to Base64?

Drop the image onto the tool or click to choose it. The Base64 data URI appears below with a preview. Switch to CSS or HTML <img> for a ready-made snippet, then copy it.

Which image formats work?

Any file your browser reports as an image, such as PNG, JPEG, GIF, WebP or SVG. The data URI keeps the original format, so a PNG stays a PNG.

Why is there a 5 MB limit?

Base64 text is about a third larger than the file, and huge data URIs make pages and stylesheets heavy. Compress images over 5 MB first.

When should I embed an image as Base64?

Data URIs suit small icons and images that must travel inside one HTML or CSS file, such as email templates or single-file pages. Larger images usually work better as separate files that browsers can cache.

Can it turn Base64 back into an image?

No. This tool only encodes images to Base64.

Is my image uploaded?

No. The file is read in your browser with the FileReader API. It is not sent to a server.