Image to Base64 Converter

Convert an image into Base64 text you can paste straight into CSS or HTML, or turn a data URI back into an image file. The file is read in your browser and never uploaded.

FreeNo sign-upImages are read with your browser's FileReader and never leave your device.

Base64 makes a file about a third larger than the original, so it suits small images such as icons and logos. The file is read in your browser and never uploaded.

How do you use the Image to Base64?

  1. Choose an image, drag it onto the tool, or paste one from your clipboard.
  2. Check the preview and sizes, then copy the data URI, raw Base64, CSS or HTML snippet you need.
  3. To go the other way, switch to Base64 to image, paste a data URI and download the file.

When should you use Base64 images?

Base64 suits small images such as icons, tiny logos and placeholders, where saving a separate request is worth a little extra text. For photos and larger graphics, a normal image file is usually the better choice because it can be cached and loaded on its own.

Why is the Base64 version bigger?

Base64 encodes every 3 bytes of the file as 4 text characters, so the output is about a third larger than the original. Compression on the server can win back some of that, but not all of it.

What else do people ask about the Image to Base64?

Is my image uploaded anywhere?

No. The tool reads the file with FileReader in your browser, so the image never leaves your device.

Which image formats work?

Any image your browser can open, such as PNG, JPEG, GIF, WebP and SVG. The data URI keeps the original file type.

What is the difference between a data URI and raw Base64?

A data URI adds a prefix such as data:image/png;base64, so browsers know the file type and can use it directly. Raw Base64 is only the encoded text, which some APIs and config files expect.

Can I turn a data URI back into an image?

Yes. Switch to Base64 to image, paste the data URI, preview it and download the file.

Which other free tools can you use?