Free tool
Base64 & Image Converter
Convert an image to a Base64 data URI, or paste one back in to preview and download the image.
Base64 & Image Converter
How to convert an image to Base64
- Choose Image → Base64.
- Upload an image.
- Copy the output. It is a complete data URI starting with data:image/, ready to paste into HTML or CSS.
How to turn Base64 back into an image
- Choose Base64 → Image.
- Paste a data URI, or a raw Base64 string without the data:image/ prefix.
- Check the preview, then press Download Image.
When to embed an image as Base64
A data URI puts the picture inside the code itself, so the page doesn't need a separate image file. That is useful for small icons and logos in HTML emails, where many email programs block linked images, for single-file HTML pages and prototypes, and for tiny images in CSS.
It is a poor fit for photos and large graphics. Base64 makes the data about a third bigger than the original file, and the browser can't cache the picture separately, so big embedded images slow a page down. As a rule of thumb, keep it to images of a few kilobytes.
The reverse direction is handy when you find a picture embedded in a web page, the source of an email or an API response and want it back as a normal file you can open and edit.