Base64 to Image

Online Free Image to Base64 Encoder / Converter

Base64 String

With this free, simple conversion tool, choose an image from your device or input an image URL from the internet. You may utilise the Data URI, IMG src components, and CSS background URL immediately by simply copying and pasting the string. There are times when you need to display an image or picture inside of a text document like HTML, CSS, XML, etc. Base64 encoding is important in this situation; you can convert an image to a Base64 string and use it. Any image file (JPG, JEPG, GIF, PNG, or WebP) may be converted to Base64. Use the Base64 to Image Converter Tool if you need to convert Base64 to an image.

How to convert image to Base64 online

  • choose the picture you want to  encode to Base64 ( You can also paste image URL from the internet)
  • Select "Convert" from the menu.
  • Take a copy of the outcome in the "Base64" field.

Output Formats:

• Plain text:

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=

• Data URI:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=

• CSS Background Image:

.base64 {

background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=")

}

• HTML Favicon:

<link rel="short icon "href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=" />

• HTML Hyperlink:

<a href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII="></a>

• HTML Image:

<img alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=" />

• HTML Iframe:

<iframe src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=">
  The “iframe” tag is not supported by your browser.
</iframe>

• JavaScript Image:

var img = new Image();
img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=";
document.body.appendChild(img);

• JavaScript Popup:

window.onclick = function () {
this.open("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=");
};

• JSON:

{
"image": {
"mime": "image/png",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII="
}
}

• XML:

<?xml version="1.0" encoding="UTF-8"?>
<root>
<image mime="image/png">iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAANQTFRFCwf8UGX6ywAAAApJREFUeJxjYAAAAAIAAUivpHEAAAAASUVORK5CYII=</image>
</root>


Aarim Khan

CEO / Co-Founder

Our goal is to provide online free tools so you don't have to install any software for basic usages. We are trying to add more tools and make these tools free forever.

We care about your data and would love to use cookies to improve your experience.