Image to base64

How to use image to base64?

  1. Select the image you want to convert to base64. 
  2. The result of the conversion will display in the textarea below. 
  3. Click the 'copy' button to copy the string in base64 format.

What is base64 ?

Base64 is a method of representing binary data based on 64 printable characters.
Base64 is often used to represent, transmit, and store some binary data in situations where text data is usually processed, including MIME emails and some complex data in XML.
The BASE64 encoding of an image is to encode an image data into a string, and use the string instead of the image address, so there is no need to use the URL address of the image.
The image to BASE64 encoding tool provides various image format conversions such as PNG to Base64, GIF to Base64, JPEG to BASE64, etc. You only need to update the image to the specified area to complete the operation!

Base64 format

data:[][;charset=][;base64], 

Base64 usage in CSS

.base64Img{ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqIAAACrCAYAAAC9kf4SAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA...."); } 

Base64 usage in HTML

<img width="200" height="200" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqIAAACrCAYAAAC9kf4SAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA...." />