Image to base64 Encoding

- Or -
Drag and drop the image here

If the image is large, conversion may take longer


Why convert images to base64 encoding

When writing web pages, there are typically two ways to incorporate an image.

  1. Directly reference the image's URI, like https://www.codeeeee.com/.../come.png
  2. Encode the image as base64 and insert it into html or css

Compared to using a URI, encoding the image in base64 mainly reduces network requests. Using the URI method, the browser needs to send an http(s) request to fetch the image content; whereas, with base64 encoding written into the document, the image downloads with the html document, eliminating the need for additional requests. However, base64 data is generally larger than the original image. Therefore, for larger images, one should weigh whether the benefits outweigh the drawbacks when using base64.