Skip to main content
Back to tools

Image to Base64

Convert images to Base64 data URIs for use in CSS or HTML

About Image to Base64

Encodes an image into Base64 and shows two outputs, the full data URI (for example data:image/png;base64,...) and the bare Base64 string, each with its own copy button. Choose a file or drag one onto the drop zone; a thumbnail, the file name and its size in KB appear above the output. Suited to icons, small inline images, CSS backgrounds and test fixtures.

Category: Media.

Frequently asked questions

Why convert an image to Base64?

▾

Base64-encoded images can be embedded directly in HTML (<img src="data:image/png;base64,...">) or CSS (background-image: url(...)), eliminating an HTTP request. Useful for small icons and inline email images.

Does Base64 increase file size?

▾

Yes. Base64 encoding increases size by approximately 33% because it represents 3 bytes of binary data as 4 ASCII characters. Use it for small images; for large images, serve them as separate files.

Is the image uploaded to a server?

▾

No. The conversion runs entirely in your browser using the FileReader API. Your image data never leaves your device.

Does the Base64 string keep the image's metadata?

▾

Yes. The file is encoded byte for byte, without resizing or recompression, so EXIF data such as GPS coordinates travels with it. If that matters, run the image through Remove EXIF first.

Related tools