Computer Privacy, Random Generators, Data Converters

Image to Base64

How to use Base64 on the web

Base64 encoding allows you to write an image or another file directly to a web page. This is useful for automatically generated images and files. Or, if you need to transfer the entire HTML document as a single file, such as the body of an e-mail formatted as HTML.

Generally speaking, at any point in HTML you can write the following instead of any URL address:


You may want to enter the image directly in the <img> tag or use the CSS styles and write it there. You can do this as follows:

<img src="data:image/jpeg;base64,xxxxxxx" alt="" />

div {background: url(data:image/png;base64,xxxxxxx);}

You can encode not only pictures, but any other file, and offer it to download. Just be careful to set the MIME correctly. You can use as MIME for example image/png, image/jpeg, application/pdf, application/zip, text/plain and many others. For example:

<a download href="data:text/plain;base64,xxxxxxx">Click</a>

You can also enter a file name to the download attribute.

Image preview

Try also other tools...

Try also other tools we offer for free. Or visit the main page where you find short description of each tool available on our web site.

Computer Privacy

Password Generator Encrypt Text Decrypt Text Random Numbers

Data Converters

Image to Base64 Base64 Encode Base64 Decode URL Escape URL Unescape Remove Accents

Copyright © 2022 MKNet Software
Of course,
we do not store any information you write on these pages nor any data which you enter for processing.
We have your privacy as our goal.