Image to Base64

How to use Image to Base64?

  1. Select the image you want to convert to Base64. 
  2. The conversion result will be displayed in the textarea below. 
  3. Click the 'Copy' button to copy the Base64-encoded string.

What is Base64?

Base64 is a method of representing binary data using 64 printable characters.
Base64 is commonly used to represent, transmit, and store binary data in contexts where text data is normally handled, including MIME emails and certain complex data within XML.
Base64 encoding of an image means converting the image data into a string, replacing the image URL with this string, thereby eliminating the need to use the image's URL.
The Image to Base64 tool supports conversion of multiple image formats, including PNG to Base64, GIF to Base64, and JPEG to Base64; simply upload your image to the designated area to complete the operation!

Base64 Format

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

Using Base64 in CSS

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

Using Base64 in HTML

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