How to use the image to base64 converter
- To encode, drop an image into the box. You get the data URL and ready-made HTML and CSS.
- Click the button for the format you need to copy it.
- To decode, paste a Base64 string or data URL in the second box and click Show image.
When to use Base64 images
A data URL lets you place a small image directly inside HTML, CSS, JSON or an email without a separate file. This saves a request and is handy for tiny icons and logos. Base64 makes data about 33% bigger, so it is not a good idea for large photos.
Frequently asked questions
How do I convert an image to Base64?
Drop the image into the first box. The Base64 string and data URL appear and you can copy them.
How do I use a Base64 image in HTML?
Copy the HTML img tag and paste it into your page. The image is embedded with no extra file.
How do I turn Base64 back into an image?
Paste the string in the second box and click Show image, then download it.
Is my image uploaded?
No. Everything happens in your browser.