Free Image to Base64 and Base64 to Image Converter
This free tool converts a PNG, JPEG, GIF or WebP image into a Base64 data URI that you can paste straight into HTML or CSS, and decodes a Base64 string or data URI back into a picture you can view and download. Upload a file or give an image address. It suits developers inlining small icons and anyone who has been sent an image as a block of text.

Image to Base64 Converter
Images
About this tool
A data URI puts the image bytes inside the text of a page or stylesheet, so the browser does not make a separate request for it. That can help for tiny icons and logos, because one request is saved. For large images it is a poor trade: Base64 makes the data about a third bigger, and an inline image cannot be cached on its own.
To encode, upload an image up to 1 MB or give a public image address. You get the data URI, a ready-made img tag and a CSS background rule, along with the image type, dimensions and size. To decode, paste a full data URI or only the Base64 text. The tool checks that it really is a supported image before showing it, then offers a download link.
Uploaded files are read in memory for this request only and never saved, and image addresses are fetched through a guarded fetcher that refuses private networks. SVG and other formats are not accepted, because they can contain scripts. Use the Base64 encoder for ordinary text.
Frequently asked questions
When should I use a Base64 data URI for an image?
For very small images, such as icons under a few kilobytes, where saving a request matters more than caching. Larger pictures are better served as normal files, because Base64 adds about a third to the size and an inline image cannot be cached or lazy loaded by itself.
Which image formats are supported?
PNG, JPEG, GIF and WebP, up to 1 MB. SVG is not accepted because an SVG file can carry scripts, and other formats are rejected because they cannot be shown safely in every browser.
How do I turn Base64 back into an image?
Choose the decode direction and paste either the full data URI that starts with data:image or just the Base64 text. If it is a valid image you will see it on the page with a download link. If nothing appears, the text is probably cut off or contains extra characters.
Are my images stored on your server?
No. An uploaded file is read for this request only and PHP removes it when the request ends. Nothing is saved or logged. Image addresses are fetched once through a safe fetcher and the picture is not kept.
