Image to Base64 Converter

A free tool that converts images to Base64 strings or data URIs. Load an image from a file, drag and drop, an image URL or the clipboard, then copy the result or save it as a .txt file.

Add an image

Load an image in any way you like

Choose a file or drag and drop it here PNG, JPEG, GIF, WebP, SVG and more / Up to 15 MB, 20 MP for raster images
Network requests are made only when you load from a URL.

Preview

Check the loaded image and its details

Image preview Your image appears here after you load it

Images from a file, drag and drop, or the clipboard are processed only in your browser.

ABOUT THIS TOOL

Convert images to Base64

This tool converts an image file into a Base64 string that you can embed directly in HTML, CSS, JSON and more. Nothing to install. Load an image in any of four ways: choose a file, drag and drop, enter an image URL, or paste from the clipboard.

How to use

  1. 1
    Load an image

    Choose a file, drag and drop it, enter a URL, or paste it.

  2. 2
    Choose an output format

    Pick a plain Base64 string, or a data URI that includes the MIME type.

  3. 3
    Copy or save

    Copy the result in one click, or save it as a text file.

Base64 only

Best when no prefix is needed, such as when sending to an API or as a JSON value.

Data URI

In the form data:image/png;base64,..., ready to use as is in HTML or CSS.

Ready to reuse

Copy, save as .txt, and see the character count, so the next step is quick.

Does Base64 change the file size?

In general, a Base64 string is about 33% larger than the original binary data. It works best for embedding small images such as icons.

Which image formats are supported?

Any format your browser can load, such as PNG, JPEG, GIF, WebP, SVG and AVIF.