Image to Base64

Encode an image as a base64 data URI you can paste straight into HTML, CSS or JSON. The MIME type and size are listed for you.

Drag and drop an image here, or

Choose an image to encode.
Your data URI will appear here…

How to use the Image to Base64 converter

Upload or drag and drop an image file.

Check the MIME type and size shown next to the preview.

Copy the data URI or download it as a .txt file.

Frequently asked questions

When should I use a base64 image?

For small icons, logos or sprites where saving a request matters. For large photos a normal image file is smaller and lets the browser cache it properly.

How much bigger is a base64 string?

About 33 percent larger than the raw file, because base64 uses four characters to store every three bytes of data.

Is my image uploaded?

No. The file is read locally with the FileReader API and encoded in your browser, so nothing is ever sent to a server.

Related tools