Image to Base64

Choose an image to get its Base64-encoded data URI, ready to paste into an <img src>, a CSS background-image, or a JSON payload. This runs entirely in your browser — your image is never uploaded.

When to use a Base64 data URI

A data URI embeds an image's bytes directly inside your HTML, CSS or JSON as text, so the browser doesn't need a separate network request to fetch it — useful for small icons, inline email images, or quick prototypes. It's not a good fit for large photos: Base64 encoding inflates the file size by roughly a third, and the browser can't cache an inline image separately from the page that contains it. Untick the prefix checkbox if you only need the raw Base64 string, for example to pair with your own Content-Type header in an API.

About this tool

This tool converts an image file into a Base64-encoded text string — useful for embedding small images directly into HTML, CSS or JSON without a separate file request, or for pasting an image as text into an API payload.

How to use it

  1. Choose the image file you want to convert.
  2. The Base64 string generates automatically, along with a ready-to-use data URI.
  3. Click "Copy" to copy the Base64 string or the full data URI.

Frequently asked questions

Does Base64 encoding make the file bigger?

Yes — Base64 encoding increases the size by roughly 33%, so it's best suited for small images (icons, small logos) rather than large photos, where a normal image file is more efficient.

What's a data URI, and when would I use it?

A data URI embeds the image directly in your HTML or CSS (like background-image: url(data:image/png;base64,...)), avoiding a separate network request — handy for small, frequently used images.

Is my image uploaded to a server?

No — the conversion happens entirely in your browser; your image file is never uploaded anywhere.